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

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

Issue 18191020: UI Resource Manager (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Added DCHECK of resource queue size to PushPropertiesTo Created 7 years, 4 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
« no previous file with comments | « cc/test/fake_scoped_ui_resource.h ('k') | cc/test/fake_scrollbar_layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
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/fake_scoped_ui_resource.h"
6
7 #include "cc/trees/layer_tree_host.h"
8
9 namespace cc {
10
11 scoped_ptr<FakeScopedUIResource> FakeScopedUIResource::Create(
12 LayerTreeHost* host) {
13 return make_scoped_ptr(new FakeScopedUIResource(host));
14 }
15
16 FakeScopedUIResource::FakeScopedUIResource(LayerTreeHost* host) {
17 ResetCounters();
18 bitmap_ = UIResourceBitmap::Create(
19 new uint8_t[1], UIResourceBitmap::RGBA8, gfx::Size(1, 1));
20 host_ = host;
21 id_ = host_->CreateUIResource(this);
22 }
23
24 scoped_refptr<UIResourceBitmap> FakeScopedUIResource::GetBitmap(
25 UIResourceId uid,
26 bool resource_lost) {
27 resource_create_count++;
28 if (resource_lost)
29 lost_resource_count++;
30 return ScopedUIResource::GetBitmap(uid, resource_lost);
31 }
32
33 void FakeScopedUIResource::ResetCounters() {
34 resource_create_count = 0;
35 lost_resource_count = 0;
36 }
37
38 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_scoped_ui_resource.h ('k') | cc/test/fake_scrollbar_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698