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

Unified Diff: trunk/src/cc/test/fake_scoped_ui_resource.cc

Issue 23740010: Revert 223162 "Update the nine patch layer to use UI resources" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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
« no previous file with comments | « trunk/src/cc/test/fake_scoped_ui_resource.h ('k') | trunk/src/cc/test/layer_tree_json_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/cc/test/fake_scoped_ui_resource.cc
===================================================================
--- trunk/src/cc/test/fake_scoped_ui_resource.cc (revision 223178)
+++ trunk/src/cc/test/fake_scoped_ui_resource.cc (working copy)
@@ -8,34 +8,25 @@
namespace cc {
-namespace {
-
-UIResourceBitmap CreateMockUIResourceBitmap() {
- SkBitmap skbitmap;
- skbitmap.setConfig(SkBitmap::kARGB_8888_Config, 1, 1);
- skbitmap.allocPixels();
- skbitmap.setImmutable();
- return UIResourceBitmap(skbitmap);
-}
-
-} // anonymous namespace
-
scoped_ptr<FakeScopedUIResource> FakeScopedUIResource::Create(
LayerTreeHost* host) {
return make_scoped_ptr(new FakeScopedUIResource(host));
}
-FakeScopedUIResource::FakeScopedUIResource(LayerTreeHost* host)
- : ScopedUIResource(host, CreateMockUIResourceBitmap()) {
- // The constructor of ScopedUIResource already created a resource so we need
- // to delete the created resource to wipe the state clean.
- host_->DeleteUIResource(id_);
+FakeScopedUIResource::FakeScopedUIResource(LayerTreeHost* host) {
ResetCounters();
+ bitmap_ = UIResourceBitmap::Create(
+ new uint8_t[1],
+ UIResourceBitmap::RGBA8,
+ UIResourceBitmap::CLAMP_TO_EDGE,
+ gfx::Size(1, 1));
+ host_ = host;
id_ = host_->CreateUIResource(this);
}
-UIResourceBitmap FakeScopedUIResource::GetBitmap(UIResourceId uid,
- bool resource_lost) {
+scoped_refptr<UIResourceBitmap> FakeScopedUIResource::GetBitmap(
+ UIResourceId uid,
+ bool resource_lost) {
resource_create_count++;
if (resource_lost)
lost_resource_count++;
« no previous file with comments | « trunk/src/cc/test/fake_scoped_ui_resource.h ('k') | trunk/src/cc/test/layer_tree_json_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698