summaryrefslogtreecommitdiffstats
path: root/cc/resources/ui_resource_bitmap.h
diff options
context:
space:
mode:
authorreed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-25 22:00:51 +0000
committerreed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-25 22:00:51 +0000
commit0046982c81ef5cf5cca021ec4bb1bfc83d0c3973 (patch)
treea601b47203a8a032442be78df0df496d42c7f37b /cc/resources/ui_resource_bitmap.h
parentc14865ce46b841b4b2f86f8016e42939b8387022 (diff)
downloadchromium_src-0046982c81ef5cf5cca021ec4bb1bfc83d0c3973.zip
chromium_src-0046982c81ef5cf5cca021ec4bb1bfc83d0c3973.tar.gz
chromium_src-0046982c81ef5cf5cca021ec4bb1bfc83d0c3973.tar.bz2
SkColorType instead of (deprecated) SkBitmap::Config
Part of this refactoring was the recognition of a common pattern: - setConfig + alloc + setImmutable + pass_to_UIResourceBitmap This CL introduces a direct way on UIResourceBitmap to create such a bitmap, by just specifying its dimensions. This encapsulates internal requirements (e.g. colortype and immutability). Review URL: https://codereview.chromium.org/197883017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259349 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/ui_resource_bitmap.h')
-rw-r--r--cc/resources/ui_resource_bitmap.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/cc/resources/ui_resource_bitmap.h b/cc/resources/ui_resource_bitmap.h
index 2cce0b3..b8863d8 100644
--- a/cc/resources/ui_resource_bitmap.h
+++ b/cc/resources/ui_resource_bitmap.h
@@ -44,14 +44,16 @@ class CC_EXPORT UIResourceBitmap {
// User must ensure that |skbitmap| is immutable. The SkBitmap Format should
// be 32-bit RGBA.
explicit UIResourceBitmap(const SkBitmap& skbitmap);
- UIResourceBitmap(const skia::RefPtr<SkPixelRef>& pixel_ref, gfx::Size size);
+ UIResourceBitmap(const gfx::Size& size, bool is_opaque);
+ UIResourceBitmap(const skia::RefPtr<SkPixelRef>& pixel_ref,
+ const gfx::Size& size);
~UIResourceBitmap();
private:
friend class AutoLockUIResourceBitmap;
void Create(const skia::RefPtr<SkPixelRef>& pixel_ref,
- gfx::Size size,
+ const gfx::Size& size,
UIResourceFormat format);
skia::RefPtr<SkPixelRef> pixel_ref_;