diff options
author | reed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-25 22:00:51 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-25 22:00:51 +0000 |
commit | 0046982c81ef5cf5cca021ec4bb1bfc83d0c3973 (patch) | |
tree | a601b47203a8a032442be78df0df496d42c7f37b /cc/layers/ui_resource_layer_unittest.cc | |
parent | c14865ce46b841b4b2f86f8016e42939b8387022 (diff) | |
download | chromium_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/layers/ui_resource_layer_unittest.cc')
-rw-r--r-- | cc/layers/ui_resource_layer_unittest.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/cc/layers/ui_resource_layer_unittest.cc b/cc/layers/ui_resource_layer_unittest.cc index 1e0e1dea..25cc2c7 100644 --- a/cc/layers/ui_resource_layer_unittest.cc +++ b/cc/layers/ui_resource_layer_unittest.cc @@ -65,8 +65,7 @@ TEST_F(UIResourceLayerTest, SetBitmap) { EXPECT_FALSE(test_layer->DrawsContent()); SkBitmap bitmap; - bitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10); - bitmap.allocPixels(); + bitmap.allocN32Pixels(10, 10); bitmap.setImmutable(); test_layer->SetBitmap(bitmap); @@ -93,13 +92,9 @@ TEST_F(UIResourceLayerTest, SetUIResourceId) { EXPECT_FALSE(test_layer->DrawsContent()); - SkBitmap bitmap; - bitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10); - bitmap.allocPixels(); - bitmap.setImmutable(); - + bool is_opaque = false; scoped_ptr<ScopedUIResource> resource = ScopedUIResource::Create( - layer_tree_host_.get(), UIResourceBitmap(bitmap)); + layer_tree_host_.get(), UIResourceBitmap(gfx::Size(10, 10), is_opaque)); test_layer->SetUIResourceId(resource->id()); test_layer->Update(&queue, &occlusion_tracker); |