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/test_ui_resource_client.h" |
| 6 #include "cc/trees/layer_tree_host.h" |
| 7 |
| 8 namespace cc { |
| 9 |
| 10 TestUIResourceClient::TestUIResourceClient() |
| 11 : id(0), |
| 12 lost_resource_count(0) { |
| 13 bitmap_ = UIResourceBitmap::Create(new uint8_t[1], |
| 14 UIResourceBitmap::RGBA8, |
| 15 gfx::Size(1, 1)); |
| 16 } |
| 17 |
| 18 scoped_refptr<UIResourceBitmap> |
| 19 TestUIResourceClient::GetBitmap(bool resource_lost) { |
| 20 if (resource_lost) |
| 21 lost_resource_count++; |
| 22 return bitmap_; |
| 23 } |
| 24 |
| 25 void TestUIResourceClient::CreateResource(LayerTreeHost* host) { |
| 26 id = host->CreateUIResource( |
| 27 base::Bind(&TestUIResourceClient::GetBitmap, this)); |
| 28 } |
| 29 |
| 30 } // namespace cc |
OLD | NEW |