| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/test/fake_scoped_ui_resource.h" | 5 #include "cc/test/fake_scoped_ui_resource.h" |
| 6 | 6 |
| 7 #include "cc/trees/layer_tree_host.h" | 7 #include "cc/trees/layer_tree_host.h" |
| 8 | 8 |
| 9 namespace cc { | 9 namespace cc { |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 UIResourceBitmap CreateMockUIResourceBitmap() { | 13 UIResourceBitmap CreateMockUIResourceBitmap() { |
| 14 SkBitmap skbitmap; | 14 bool is_opaque = false; |
| 15 skbitmap.setConfig(SkBitmap::kARGB_8888_Config, 1, 1); | 15 return UIResourceBitmap(gfx::Size(1, 1), is_opaque); |
| 16 skbitmap.allocPixels(); | |
| 17 skbitmap.setImmutable(); | |
| 18 return UIResourceBitmap(skbitmap); | |
| 19 } | 16 } |
| 20 | 17 |
| 21 } // anonymous namespace | 18 } // anonymous namespace |
| 22 | 19 |
| 23 scoped_ptr<FakeScopedUIResource> FakeScopedUIResource::Create( | 20 scoped_ptr<FakeScopedUIResource> FakeScopedUIResource::Create( |
| 24 LayerTreeHost* host) { | 21 LayerTreeHost* host) { |
| 25 return make_scoped_ptr(new FakeScopedUIResource(host)); | 22 return make_scoped_ptr(new FakeScopedUIResource(host)); |
| 26 } | 23 } |
| 27 | 24 |
| 28 FakeScopedUIResource::FakeScopedUIResource(LayerTreeHost* host) | 25 FakeScopedUIResource::FakeScopedUIResource(LayerTreeHost* host) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 41 lost_resource_count++; | 38 lost_resource_count++; |
| 42 return ScopedUIResource::GetBitmap(uid, resource_lost); | 39 return ScopedUIResource::GetBitmap(uid, resource_lost); |
| 43 } | 40 } |
| 44 | 41 |
| 45 void FakeScopedUIResource::ResetCounters() { | 42 void FakeScopedUIResource::ResetCounters() { |
| 46 resource_create_count = 0; | 43 resource_create_count = 0; |
| 47 lost_resource_count = 0; | 44 lost_resource_count = 0; |
| 48 } | 45 } |
| 49 | 46 |
| 50 } // namespace cc | 47 } // namespace cc |
| OLD | NEW |