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

Side by Side Diff: cc/test/test_ui_resource_client.cc

Issue 18191020: UI Resource Manager (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 5 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698