Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: cc/resources/ui_resource_bitmap.cc

Issue 2856483002: experiments with uiresourcebitmap
Patch Set: unittest Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/resources/ui_resource_bitmap.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/resources/ui_resource_bitmap.h" 5 #include "cc/resources/ui_resource_bitmap.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 SkAlphaType alphaType = is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType; 74 SkAlphaType alphaType = is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
75 SkImageInfo info = 75 SkImageInfo info =
76 SkImageInfo::MakeN32(size.width(), size.height(), alphaType); 76 SkImageInfo::MakeN32(size.width(), size.height(), alphaType);
77 sk_sp<SkPixelRef> pixel_ref( 77 sk_sp<SkPixelRef> pixel_ref(
78 SkMallocPixelRef::MakeAllocate(info, info.minRowBytes(), NULL)); 78 SkMallocPixelRef::MakeAllocate(info, info.minRowBytes(), NULL));
79 pixel_ref->setImmutable(); 79 pixel_ref->setImmutable();
80 Create(std::move(pixel_ref), size, UIResourceBitmap::RGBA8); 80 Create(std::move(pixel_ref), size, UIResourceBitmap::RGBA8);
81 SetOpaque(is_opaque); 81 SetOpaque(is_opaque);
82 } 82 }
83 83
84 UIResourceBitmap::UIResourceBitmap(sk_sp<SkPixelRef> pixel_ref,
85 const gfx::Size& size) {
86 Create(std::move(pixel_ref), size, UIResourceBitmap::ETC1);
87 }
88
89 UIResourceBitmap::UIResourceBitmap(const UIResourceBitmap& other) = default; 84 UIResourceBitmap::UIResourceBitmap(const UIResourceBitmap& other) = default;
90 85
91 UIResourceBitmap::~UIResourceBitmap() {} 86 UIResourceBitmap::~UIResourceBitmap() {}
92 } // namespace cc 87 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/ui_resource_bitmap.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698