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

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

Issue 139233002: [#4] Pass gfx structs by const ref (gfx::PointF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected as per review comments! Created 6 years, 11 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/quads/texture_draw_quad.h » ('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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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();
63 } 63 }
64 64
65 void UIResourceLayerImpl::SetUV(gfx::PointF top_left, 65 void UIResourceLayerImpl::SetUV(const gfx::PointF& top_left,
66 gfx::PointF bottom_right) { 66 const gfx::PointF& bottom_right) {
67 if (uv_top_left_ == top_left && uv_bottom_right_ == bottom_right) 67 if (uv_top_left_ == top_left && uv_bottom_right_ == bottom_right)
68 return; 68 return;
69 uv_top_left_ = top_left; 69 uv_top_left_ = top_left;
70 uv_bottom_right_ = bottom_right; 70 uv_bottom_right_ = bottom_right;
71 NoteLayerPropertyChanged(); 71 NoteLayerPropertyChanged();
72 } 72 }
73 73
74 void UIResourceLayerImpl::SetVertexOpacity(const float vertex_opacity[4]) { 74 void UIResourceLayerImpl::SetVertexOpacity(const float vertex_opacity[4]) {
75 if (vertex_opacity_[0] == vertex_opacity[0] && 75 if (vertex_opacity_[0] == vertex_opacity[0] &&
76 vertex_opacity_[1] == vertex_opacity[1] && 76 vertex_opacity_[1] == vertex_opacity[1] &&
(...skipping 71 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/quads/texture_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698