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

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

Issue 1144523003: Rename cc::ResourceProvider::ResourceId to cc::ResourceId and move it to its own file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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_ui_resource_layer_tree_host_impl.h ('k') | cc/test/render_pass_test_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_ui_resource_layer_tree_host_impl.h" 5 #include "cc/test/fake_ui_resource_layer_tree_host_impl.h"
6 6
7 #include "cc/resources/ui_resource_bitmap.h" 7 #include "cc/resources/ui_resource_bitmap.h"
8 #include "cc/test/fake_layer_tree_host_impl.h" 8 #include "cc/test/fake_layer_tree_host_impl.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 16 matching lines...) Expand all
27 data.resource_id = resource_provider()->CreateResource( 27 data.resource_id = resource_provider()->CreateResource(
28 bitmap.GetSize(), GL_CLAMP_TO_EDGE, 28 bitmap.GetSize(), GL_CLAMP_TO_EDGE,
29 ResourceProvider::TEXTURE_HINT_IMMUTABLE, RGBA_8888); 29 ResourceProvider::TEXTURE_HINT_IMMUTABLE, RGBA_8888);
30 30
31 data.size = bitmap.GetSize(); 31 data.size = bitmap.GetSize();
32 data.opaque = bitmap.GetOpaque(); 32 data.opaque = bitmap.GetOpaque();
33 fake_ui_resource_map_[uid] = data; 33 fake_ui_resource_map_[uid] = data;
34 } 34 }
35 35
36 void FakeUIResourceLayerTreeHostImpl::DeleteUIResource(UIResourceId uid) { 36 void FakeUIResourceLayerTreeHostImpl::DeleteUIResource(UIResourceId uid) {
37 ResourceProvider::ResourceId id = ResourceIdForUIResource(uid); 37 ResourceId id = ResourceIdForUIResource(uid);
38 if (id) 38 if (id)
39 fake_ui_resource_map_.erase(uid); 39 fake_ui_resource_map_.erase(uid);
40 } 40 }
41 41
42 ResourceProvider::ResourceId 42 ResourceId FakeUIResourceLayerTreeHostImpl::ResourceIdForUIResource(
43 FakeUIResourceLayerTreeHostImpl::ResourceIdForUIResource( 43 UIResourceId uid) const {
44 UIResourceId uid) const {
45 UIResourceMap::const_iterator iter = fake_ui_resource_map_.find(uid); 44 UIResourceMap::const_iterator iter = fake_ui_resource_map_.find(uid);
46 if (iter != fake_ui_resource_map_.end()) 45 if (iter != fake_ui_resource_map_.end())
47 return iter->second.resource_id; 46 return iter->second.resource_id;
48 return 0; 47 return 0;
49 } 48 }
50 49
51 bool FakeUIResourceLayerTreeHostImpl::IsUIResourceOpaque(UIResourceId uid) 50 bool FakeUIResourceLayerTreeHostImpl::IsUIResourceOpaque(UIResourceId uid)
52 const { 51 const {
53 UIResourceMap::const_iterator iter = fake_ui_resource_map_.find(uid); 52 UIResourceMap::const_iterator iter = fake_ui_resource_map_.find(uid);
54 DCHECK(iter != fake_ui_resource_map_.end()); 53 DCHECK(iter != fake_ui_resource_map_.end());
55 return iter->second.opaque; 54 return iter->second.opaque;
56 } 55 }
57 56
58 } // namespace cc 57 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_ui_resource_layer_tree_host_impl.h ('k') | cc/test/render_pass_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698