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

Side by Side Diff: cc/layers/ui_resource_layer.cc

Issue 1122393003: CC: Plumb LayerSettings parameter for cc::Layer construction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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/layers/ui_resource_layer.h ('k') | cc/layers/ui_resource_layer_unittest.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/layers/ui_resource_layer.h" 5 #include "cc/layers/ui_resource_layer.h"
6 6
7 #include "cc/layers/ui_resource_layer_impl.h" 7 #include "cc/layers/ui_resource_layer_impl.h"
8 #include "cc/resources/prioritized_resource.h" 8 #include "cc/resources/prioritized_resource.h"
9 #include "cc/resources/resource_update.h" 9 #include "cc/resources/resource_update.h"
10 #include "cc/resources/resource_update_queue.h" 10 #include "cc/resources/resource_update_queue.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 private: 44 private:
45 explicit SharedUIResourceHolder(UIResourceId id) : id_(id) {} 45 explicit SharedUIResourceHolder(UIResourceId id) : id_(id) {}
46 46
47 UIResourceId id_; 47 UIResourceId id_;
48 }; 48 };
49 49
50 } // anonymous namespace 50 } // anonymous namespace
51 51
52 UIResourceLayer::UIResourceHolder::~UIResourceHolder() {} 52 UIResourceLayer::UIResourceHolder::~UIResourceHolder() {}
53 53
54 scoped_refptr<UIResourceLayer> UIResourceLayer::Create() { 54 scoped_refptr<UIResourceLayer> UIResourceLayer::Create(
55 return make_scoped_refptr(new UIResourceLayer()); 55 const LayerSettings& settings) {
56 return make_scoped_refptr(new UIResourceLayer(settings));
56 } 57 }
57 58
58 UIResourceLayer::UIResourceLayer() 59 UIResourceLayer::UIResourceLayer(const LayerSettings& settings)
59 : Layer(), 60 : Layer(settings), uv_top_left_(0.f, 0.f), uv_bottom_right_(1.f, 1.f) {
60 uv_top_left_(0.f, 0.f),
61 uv_bottom_right_(1.f, 1.f) {
62 vertex_opacity_[0] = 1.0f; 61 vertex_opacity_[0] = 1.0f;
63 vertex_opacity_[1] = 1.0f; 62 vertex_opacity_[1] = 1.0f;
64 vertex_opacity_[2] = 1.0f; 63 vertex_opacity_[2] = 1.0f;
65 vertex_opacity_[3] = 1.0f; 64 vertex_opacity_[3] = 1.0f;
66 } 65 }
67 66
68 UIResourceLayer::~UIResourceLayer() {} 67 UIResourceLayer::~UIResourceLayer() {}
69 68
70 scoped_ptr<LayerImpl> UIResourceLayer::CreateLayerImpl( 69 scoped_ptr<LayerImpl> UIResourceLayer::CreateLayerImpl(
71 LayerTreeImpl* tree_impl) { 70 LayerTreeImpl* tree_impl) {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 gfx::Size image_size = 162 gfx::Size image_size =
164 layer_tree_host()->GetUIResourceSize(ui_resource_holder_->id()); 163 layer_tree_host()->GetUIResourceSize(ui_resource_holder_->id());
165 layer_impl->SetUIResourceId(ui_resource_holder_->id()); 164 layer_impl->SetUIResourceId(ui_resource_holder_->id());
166 layer_impl->SetImageBounds(image_size); 165 layer_impl->SetImageBounds(image_size);
167 layer_impl->SetUV(uv_top_left_, uv_bottom_right_); 166 layer_impl->SetUV(uv_top_left_, uv_bottom_right_);
168 layer_impl->SetVertexOpacity(vertex_opacity_); 167 layer_impl->SetVertexOpacity(vertex_opacity_);
169 } 168 }
170 } 169 }
171 170
172 } // namespace cc 171 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/ui_resource_layer.h ('k') | cc/layers/ui_resource_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698