summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_scoped_ui_resource.cc
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/test/fake_scoped_ui_resource.cc
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/test/fake_scoped_ui_resource.cc')
-rw-r--r--cc/test/fake_scoped_ui_resource.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/cc/test/fake_scoped_ui_resource.cc b/cc/test/fake_scoped_ui_resource.cc
index bf86f54..0631cd8 100644
--- a/cc/test/fake_scoped_ui_resource.cc
+++ b/cc/test/fake_scoped_ui_resource.cc
@@ -11,11 +11,8 @@ namespace cc {
namespace {
UIResourceBitmap CreateMockUIResourceBitmap() {
- SkBitmap skbitmap;
- skbitmap.setConfig(SkBitmap::kARGB_8888_Config, 1, 1);
- skbitmap.allocPixels();
- skbitmap.setImmutable();
- return UIResourceBitmap(skbitmap);
+ bool is_opaque = false;
+ return UIResourceBitmap(gfx::Size(1, 1), is_opaque);
}
} // anonymous namespace