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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 22870016: Update the nine patch layer to use UI resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: UIResourceBitmap holds SkPixelRef* instead of uint8_t* Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 686efc3695cdabacd36546ffaeb97d6db6c51db5..bccda687f1e98cb2a893e815c70133d5b5864712 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -6345,9 +6345,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, gfx::Size(1, 1));
+ UIResourceBitmap bitmap(skbitmap);
host_impl_->CreateUIResource(ui_resource_id, bitmap);
EXPECT_EQ(1u, context3d->NumTextures());
ResourceProvider::ResourceId id1 =

Powered by Google App Engine
This is Rietveld 408576698