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

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

Issue 853393002: cc: refactor of MathUtil::AddToTracedValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/content_draw_quad_base.cc ('k') | cc/quads/io_surface_draw_quad.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 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/debug/trace_event_argument.h" 7 #include "base/debug/trace_event_argument.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 DCHECK(material != INVALID); 54 DCHECK(material != INVALID);
55 } 55 }
56 56
57 DrawQuad::~DrawQuad() { 57 DrawQuad::~DrawQuad() {
58 } 58 }
59 59
60 void DrawQuad::AsValueInto(base::debug::TracedValue* value) const { 60 void DrawQuad::AsValueInto(base::debug::TracedValue* value) const {
61 value->SetInteger("material", material); 61 value->SetInteger("material", material);
62 TracedValue::SetIDRef(shared_quad_state, value, "shared_state"); 62 TracedValue::SetIDRef(shared_quad_state, value, "shared_state");
63 63
64 value->BeginArray("content_space_rect"); 64 MathUtil::AddToTracedValue("content_space_rect", rect, value);
65 MathUtil::AddToTracedValue(rect, value);
66 value->EndArray();
67 65
68 bool rect_is_clipped; 66 bool rect_is_clipped;
69 gfx::QuadF rect_as_target_space_quad = MathUtil::MapQuad( 67 gfx::QuadF rect_as_target_space_quad = MathUtil::MapQuad(
70 shared_quad_state->content_to_target_transform, 68 shared_quad_state->content_to_target_transform,
71 gfx::QuadF(rect), 69 gfx::QuadF(rect),
72 &rect_is_clipped); 70 &rect_is_clipped);
73 value->BeginArray("rect_as_target_space_quad"); 71 MathUtil::AddToTracedValue("rect_as_target_space_quad",
74 MathUtil::AddToTracedValue(rect_as_target_space_quad, value); 72 rect_as_target_space_quad, value);
75 value->EndArray();
76 73
77 value->SetBoolean("rect_is_clipped", rect_is_clipped); 74 value->SetBoolean("rect_is_clipped", rect_is_clipped);
78 75
79 value->BeginArray("content_space_opaque_rect"); 76 MathUtil::AddToTracedValue("content_space_opaque_rect", opaque_rect, value);
80 MathUtil::AddToTracedValue(opaque_rect, value);
81 value->EndArray();
82 77
83 bool opaque_rect_is_clipped; 78 bool opaque_rect_is_clipped;
84 gfx::QuadF opaque_rect_as_target_space_quad = MathUtil::MapQuad( 79 gfx::QuadF opaque_rect_as_target_space_quad = MathUtil::MapQuad(
85 shared_quad_state->content_to_target_transform, 80 shared_quad_state->content_to_target_transform,
86 gfx::QuadF(opaque_rect), 81 gfx::QuadF(opaque_rect),
87 &opaque_rect_is_clipped); 82 &opaque_rect_is_clipped);
88 value->BeginArray("opaque_rect_as_target_space_quad"); 83 MathUtil::AddToTracedValue("opaque_rect_as_target_space_quad",
89 MathUtil::AddToTracedValue(opaque_rect_as_target_space_quad, value); 84 opaque_rect_as_target_space_quad, value);
90 value->EndArray();
91 85
92 value->SetBoolean("opaque_rect_is_clipped", opaque_rect_is_clipped); 86 value->SetBoolean("opaque_rect_is_clipped", opaque_rect_is_clipped);
93 87
94 value->BeginArray("content_space_visible_rect"); 88 MathUtil::AddToTracedValue("content_space_visible_rect", visible_rect, value);
95 MathUtil::AddToTracedValue(visible_rect, value);
96 value->EndArray();
97 89
98 bool visible_rect_is_clipped; 90 bool visible_rect_is_clipped;
99 gfx::QuadF visible_rect_as_target_space_quad = MathUtil::MapQuad( 91 gfx::QuadF visible_rect_as_target_space_quad = MathUtil::MapQuad(
100 shared_quad_state->content_to_target_transform, 92 shared_quad_state->content_to_target_transform,
101 gfx::QuadF(visible_rect), 93 gfx::QuadF(visible_rect),
102 &visible_rect_is_clipped); 94 &visible_rect_is_clipped);
103 95
104 value->BeginArray("visible_rect_as_target_space_quad"); 96 MathUtil::AddToTracedValue("visible_rect_as_target_space_quad",
105 MathUtil::AddToTracedValue(visible_rect_as_target_space_quad, value); 97 visible_rect_as_target_space_quad, value);
106 value->EndArray();
107 98
108 value->SetBoolean("visible_rect_is_clipped", visible_rect_is_clipped); 99 value->SetBoolean("visible_rect_is_clipped", visible_rect_is_clipped);
109 100
110 value->SetBoolean("needs_blending", needs_blending); 101 value->SetBoolean("needs_blending", needs_blending);
111 value->SetBoolean("should_draw_with_blending", ShouldDrawWithBlending()); 102 value->SetBoolean("should_draw_with_blending", ShouldDrawWithBlending());
112 ExtendValue(value); 103 ExtendValue(value);
113 } 104 }
114 105
115 } // namespace cc 106 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quads/content_draw_quad_base.cc ('k') | cc/quads/io_surface_draw_quad.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698