OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/test/fake_scoped_ui_resource.h" |
| 6 |
| 7 #include "cc/trees/layer_tree_host.h" |
| 8 |
| 9 namespace cc { |
| 10 |
| 11 FakeScopedUIResource::FakeScopedUIResource(LayerTreeHost* host) { |
| 12 ResetCounters(); |
| 13 bitmap_ = UIResourceBitmap::Create(new uint8_t[1], |
| 14 UIResourceBitmap::RGBA8, |
| 15 gfx::Size(1, 1)); |
| 16 host_ = host; |
| 17 id_ = host_->CreateUIResource(this); |
| 18 } |
| 19 |
| 20 scoped_refptr<UIResourceBitmap> FakeScopedUIResource::Create( |
| 21 bool resource_lost) { |
| 22 resource_create_count++; |
| 23 if (resource_lost) |
| 24 lost_resource_count++; |
| 25 return ScopedUIResource::Create(resource_lost); |
| 26 } |
| 27 |
| 28 void FakeScopedUIResource::ResetCounters() { |
| 29 resource_create_count = 0; |
| 30 lost_resource_count = 0; |
| 31 } |
| 32 |
| 33 } // namespace cc |
OLD | NEW |