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

Side by Side Diff: cc/quads/draw_quad.cc

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! 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/quads/draw_quad.h ('k') | cc/quads/io_surface_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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/quads/draw_quad.h" 5 #include "cc/quads/draw_quad.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.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/debug/traced_value.h" 10 #include "cc/debug/traced_value.h"
(...skipping 18 matching lines...) Expand all
29 namespace cc { 29 namespace cc {
30 30
31 DrawQuad::DrawQuad() 31 DrawQuad::DrawQuad()
32 : material(INVALID), 32 : material(INVALID),
33 needs_blending(false), 33 needs_blending(false),
34 shared_quad_state() { 34 shared_quad_state() {
35 } 35 }
36 36
37 void DrawQuad::SetAll(const SharedQuadState* shared_quad_state, 37 void DrawQuad::SetAll(const SharedQuadState* shared_quad_state,
38 Material material, 38 Material material,
39 gfx::Rect rect, 39 const gfx::Rect& rect,
40 gfx::Rect opaque_rect, 40 const gfx::Rect& opaque_rect,
41 gfx::Rect visible_rect, 41 const gfx::Rect& visible_rect,
42 bool needs_blending) { 42 bool needs_blending) {
43 DCHECK(rect.Contains(visible_rect)) << "rect: " << rect.ToString() 43 DCHECK(rect.Contains(visible_rect)) << "rect: " << rect.ToString()
44 << " visible_rect: " 44 << " visible_rect: "
45 << visible_rect.ToString(); 45 << visible_rect.ToString();
46 DCHECK(opaque_rect.IsEmpty() || rect.Contains(opaque_rect)) 46 DCHECK(opaque_rect.IsEmpty() || rect.Contains(opaque_rect))
47 << "rect: " << rect.ToString() << "opaque_rect " 47 << "rect: " << rect.ToString() << "opaque_rect "
48 << opaque_rect.ToString(); 48 << opaque_rect.ToString();
49 49
50 this->material = material; 50 this->material = material;
51 this->rect = rect; 51 this->rect = rect;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 MathUtil::AsValue(visible_rect_as_target_space_quad).release()); 139 MathUtil::AsValue(visible_rect_as_target_space_quad).release());
140 value->SetBoolean("visible_rect_is_clipped", visible_rect_is_clipped); 140 value->SetBoolean("visible_rect_is_clipped", visible_rect_is_clipped);
141 141
142 value->SetBoolean("needs_blending", needs_blending); 142 value->SetBoolean("needs_blending", needs_blending);
143 value->SetBoolean("should_draw_with_blending", ShouldDrawWithBlending()); 143 value->SetBoolean("should_draw_with_blending", ShouldDrawWithBlending());
144 ExtendValue(value.get()); 144 ExtendValue(value.get());
145 return value.PassAs<base::Value>(); 145 return value.PassAs<base::Value>();
146 } 146 }
147 147
148 } // namespace cc 148 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quads/draw_quad.h ('k') | cc/quads/io_surface_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698