diff options
author | powei@chromium.org <powei@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-20 03:34:14 +0000 |
---|---|---|
committer | powei@chromium.org <powei@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-20 03:34:14 +0000 |
commit | 741fba42846459cbecdeb933f98e74bffdc0e306 (patch) | |
tree | 318ace136ecc0ef477c912cb8e98352a6e45e665 /cc/trees/layer_tree_host_impl_unittest.cc | |
parent | 0dff241faa6cc89083d24f6443cf03695e64f1e4 (diff) | |
download | chromium_src-741fba42846459cbecdeb933f98e74bffdc0e306.zip chromium_src-741fba42846459cbecdeb933f98e74bffdc0e306.tar.gz chromium_src-741fba42846459cbecdeb933f98e74bffdc0e306.tar.bz2 |
Update the nine patch layer to use UI resources
The old nine-patch layer used priority resource manager for requesting textures.
This patch updates the nine-patch layer to use the UI resource manager.
this patch clarifies the semantics of the aperture in both image and layer
The new semantics corresponds to existing logic on the android-side.
Changes have been made to UIResourceBitmap to use SkPixelRef as ref-counted
of the bitmap content.
The android-side changes:
https://gerrit-int.chromium.org/#/c/43103/
[Update 8/13/2013] Reverted due to "regression"
( https://code.google.com/p/chromium/issues/detail?id=290215 ):
https://codereview.chromium.org/23620047/
[Update 8/13/2013] Reverted due to failed mac_gpu bot:
https://codereview.chromium.org/23740010/
BUG=276482,276487,290215
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=222732
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=223162
Review URL: https://chromiumcodereview.appspot.com/22870016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224270 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/trees/layer_tree_host_impl_unittest.cc')
-rw-r--r-- | cc/trees/layer_tree_host_impl_unittest.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index d386795..c184c67 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -3075,12 +3075,13 @@ TEST_F(LayerTreeHostImplViewportCoveredTest, ViewportCoveredOverhangBitmap) { host_impl_->SetViewportSize(DipSizeToPixelSize(viewport_size_)); SetupActiveTreeLayers(); + SkBitmap skbitmap; + skbitmap.setConfig(SkBitmap::kARGB_8888_Config, 2, 2); + skbitmap.allocPixels(); + skbitmap.setImmutable(); + // Specify an overhang bitmap to use. - scoped_refptr<UIResourceBitmap> ui_resource_bitmap(UIResourceBitmap::Create( - new uint8_t[4], - UIResourceBitmap::RGBA8, - UIResourceBitmap::REPEAT, - gfx::Size(1, 1))); + UIResourceBitmap ui_resource_bitmap(skbitmap, UIResourceBitmap::REPEAT); UIResourceId ui_resource_id = 12345; host_impl_->CreateUIResource(ui_resource_id, ui_resource_bitmap); host_impl_->SetOverhangUIResource(ui_resource_id, gfx::Size(32, 32)); @@ -6547,12 +6548,13 @@ TEST_F(LayerTreeHostImplTest, UIResourceManagement) { EXPECT_EQ(0u, context3d->NumTextures()); + SkBitmap skbitmap; + skbitmap.setConfig(SkBitmap::kARGB_8888_Config, 1, 1); + skbitmap.allocPixels(); + skbitmap.setImmutable(); + UIResourceId ui_resource_id = 1; - scoped_refptr<UIResourceBitmap> bitmap = UIResourceBitmap::Create( - new uint8_t[1], - UIResourceBitmap::RGBA8, - UIResourceBitmap::CLAMP_TO_EDGE, - gfx::Size(1, 1)); + UIResourceBitmap bitmap(skbitmap); host_impl_->CreateUIResource(ui_resource_id, bitmap); EXPECT_EQ(1u, context3d->NumTextures()); ResourceProvider::ResourceId id1 = |