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

Unified Diff: cc/test/fake_scoped_ui_resource.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/test/fake_scoped_ui_resource.cc
diff --git a/cc/test/fake_scoped_ui_resource.cc b/cc/test/fake_scoped_ui_resource.cc
index 02f0fa9b12f0201f82c4443400944a254a920721..cdec4a71303acb5a4df28662f9245e21fccdfe62 100644
--- a/cc/test/fake_scoped_ui_resource.cc
+++ b/cc/test/fake_scoped_ui_resource.cc
@@ -15,15 +15,17 @@ scoped_ptr<FakeScopedUIResource> FakeScopedUIResource::Create(
FakeScopedUIResource::FakeScopedUIResource(LayerTreeHost* host) {
ResetCounters();
- bitmap_ = UIResourceBitmap::Create(
- new uint8_t[1], UIResourceBitmap::RGBA8, gfx::Size(1, 1));
host_ = host;
- id_ = host_->CreateUIResource(this);
+ SkBitmap skbitmap;
+ skbitmap.setConfig(SkBitmap::kARGB_8888_Config, 1, 1);
+ skbitmap.allocPixels();
+ skbitmap.setImmutable();
+ bitmap_ = UIResourceBitmap(skbitmap);
+ id_ = host->CreateUIResource(this);
}
-scoped_refptr<UIResourceBitmap> FakeScopedUIResource::GetBitmap(
- UIResourceId uid,
- bool resource_lost) {
+UIResourceBitmap FakeScopedUIResource::GetBitmap(UIResourceId uid,
+ bool resource_lost) {
resource_create_count++;
if (resource_lost)
lost_resource_count++;

Powered by Google App Engine
This is Rietveld 408576698