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

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

Issue 145313006: [#7] Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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_impl.h ('k') | cc/layers/ui_resource_layer_impl_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_impl.h" 5 #include "cc/layers/ui_resource_layer_impl.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/layers/quad_sink.h" 10 #include "cc/layers/quad_sink.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 layer_impl->SetVertexOpacity(vertex_opacity_); 42 layer_impl->SetVertexOpacity(vertex_opacity_);
43 } 43 }
44 44
45 void UIResourceLayerImpl::SetUIResourceId(UIResourceId uid) { 45 void UIResourceLayerImpl::SetUIResourceId(UIResourceId uid) {
46 if (uid == ui_resource_id_) 46 if (uid == ui_resource_id_)
47 return; 47 return;
48 ui_resource_id_ = uid; 48 ui_resource_id_ = uid;
49 NoteLayerPropertyChanged(); 49 NoteLayerPropertyChanged();
50 } 50 }
51 51
52 void UIResourceLayerImpl::SetImageBounds(gfx::Size image_bounds) { 52 void UIResourceLayerImpl::SetImageBounds(const gfx::Size& image_bounds) {
53 // This check imposes an ordering on the call sequence. An UIResource must 53 // This check imposes an ordering on the call sequence. An UIResource must
54 // exist before SetImageBounds can be called. 54 // exist before SetImageBounds can be called.
55 DCHECK(ui_resource_id_); 55 DCHECK(ui_resource_id_);
56 56
57 if (image_bounds_ == image_bounds) 57 if (image_bounds_ == image_bounds)
58 return; 58 return;
59 59
60 image_bounds_ = image_bounds; 60 image_bounds_ = image_bounds;
61 61
62 NoteLayerPropertyChanged(); 62 NoteLayerPropertyChanged();
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 list->AppendDouble(vertex_opacity_[3]); 148 list->AppendDouble(vertex_opacity_[3]);
149 result->Set("VertexOpacity", list); 149 result->Set("VertexOpacity", list);
150 150
151 result->Set("UVTopLeft", MathUtil::AsValue(uv_top_left_).release()); 151 result->Set("UVTopLeft", MathUtil::AsValue(uv_top_left_).release());
152 result->Set("UVBottomRight", MathUtil::AsValue(uv_bottom_right_).release()); 152 result->Set("UVBottomRight", MathUtil::AsValue(uv_bottom_right_).release());
153 153
154 return result; 154 return result;
155 } 155 }
156 156
157 } // namespace cc 157 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/ui_resource_layer_impl.h ('k') | cc/layers/ui_resource_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698