| OLD | NEW |
| 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 "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
| 8 #include "cc/layers/ui_resource_layer_impl.h" | 8 #include "cc/layers/ui_resource_layer_impl.h" |
| 9 #include "cc/resources/scoped_ui_resource.h" | 9 #include "cc/resources/scoped_ui_resource.h" |
| 10 #include "cc/resources/ui_resource_bitmap.h" | 10 #include "cc/resources/ui_resource_bitmap.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 private: | 42 private: |
| 43 explicit SharedUIResourceHolder(UIResourceId id) : id_(id) {} | 43 explicit SharedUIResourceHolder(UIResourceId id) : id_(id) {} |
| 44 | 44 |
| 45 UIResourceId id_; | 45 UIResourceId id_; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 } // anonymous namespace | 48 } // anonymous namespace |
| 49 | 49 |
| 50 UIResourceLayer::UIResourceHolder::~UIResourceHolder() {} | 50 UIResourceLayer::UIResourceHolder::~UIResourceHolder() {} |
| 51 | 51 |
| 52 scoped_refptr<UIResourceLayer> UIResourceLayer::Create( | 52 scoped_refptr<UIResourceLayer> UIResourceLayer::Create() { |
| 53 const LayerSettings& settings) { | 53 return make_scoped_refptr(new UIResourceLayer()); |
| 54 return make_scoped_refptr(new UIResourceLayer(settings)); | |
| 55 } | 54 } |
| 56 | 55 |
| 57 UIResourceLayer::UIResourceLayer(const LayerSettings& settings) | 56 UIResourceLayer::UIResourceLayer() |
| 58 : Layer(settings), uv_top_left_(0.f, 0.f), uv_bottom_right_(1.f, 1.f) { | 57 : Layer(), uv_top_left_(0.f, 0.f), uv_bottom_right_(1.f, 1.f) { |
| 59 vertex_opacity_[0] = 1.0f; | 58 vertex_opacity_[0] = 1.0f; |
| 60 vertex_opacity_[1] = 1.0f; | 59 vertex_opacity_[1] = 1.0f; |
| 61 vertex_opacity_[2] = 1.0f; | 60 vertex_opacity_[2] = 1.0f; |
| 62 vertex_opacity_[3] = 1.0f; | 61 vertex_opacity_[3] = 1.0f; |
| 63 } | 62 } |
| 64 | 63 |
| 65 UIResourceLayer::~UIResourceLayer() {} | 64 UIResourceLayer::~UIResourceLayer() {} |
| 66 | 65 |
| 67 scoped_ptr<LayerImpl> UIResourceLayer::CreateLayerImpl( | 66 scoped_ptr<LayerImpl> UIResourceLayer::CreateLayerImpl( |
| 68 LayerTreeImpl* tree_impl) { | 67 LayerTreeImpl* tree_impl) { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 gfx::Size image_size = | 160 gfx::Size image_size = |
| 162 layer_tree_host()->GetUIResourceSize(ui_resource_holder_->id()); | 161 layer_tree_host()->GetUIResourceSize(ui_resource_holder_->id()); |
| 163 layer_impl->SetUIResourceId(ui_resource_holder_->id()); | 162 layer_impl->SetUIResourceId(ui_resource_holder_->id()); |
| 164 layer_impl->SetImageBounds(image_size); | 163 layer_impl->SetImageBounds(image_size); |
| 165 layer_impl->SetUV(uv_top_left_, uv_bottom_right_); | 164 layer_impl->SetUV(uv_top_left_, uv_bottom_right_); |
| 166 layer_impl->SetVertexOpacity(vertex_opacity_); | 165 layer_impl->SetVertexOpacity(vertex_opacity_); |
| 167 } | 166 } |
| 168 } | 167 } |
| 169 | 168 |
| 170 } // namespace cc | 169 } // namespace cc |
| OLD | NEW |