OLD | NEW |
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/trace_event/trace_event_argument.h" | 8 #include "base/trace_event/trace_event_argument.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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 DrawQuad::~DrawQuad() { | 55 DrawQuad::~DrawQuad() { |
56 } | 56 } |
57 | 57 |
58 void DrawQuad::AsValueInto(base::trace_event::TracedValue* value) const { | 58 void DrawQuad::AsValueInto(base::trace_event::TracedValue* value) const { |
59 value->SetInteger("material", material); | 59 value->SetInteger("material", material); |
60 TracedValue::SetIDRef(shared_quad_state, value, "shared_state"); | 60 TracedValue::SetIDRef(shared_quad_state, value, "shared_state"); |
61 | 61 |
62 MathUtil::AddToTracedValue("content_space_rect", rect, value); | 62 MathUtil::AddToTracedValue("content_space_rect", rect, value); |
63 | 63 |
64 bool rect_is_clipped; | 64 bool rect_is_clipped; |
65 gfx::QuadF rect_as_target_space_quad = MathUtil::MapQuad( | 65 gfx::QuadF rect_as_target_space_quad = |
66 shared_quad_state->content_to_target_transform, | 66 MathUtil::MapQuad(shared_quad_state->quad_to_target_transform, |
67 gfx::QuadF(rect), | 67 gfx::QuadF(rect), &rect_is_clipped); |
68 &rect_is_clipped); | |
69 MathUtil::AddToTracedValue("rect_as_target_space_quad", | 68 MathUtil::AddToTracedValue("rect_as_target_space_quad", |
70 rect_as_target_space_quad, value); | 69 rect_as_target_space_quad, value); |
71 | 70 |
72 value->SetBoolean("rect_is_clipped", rect_is_clipped); | 71 value->SetBoolean("rect_is_clipped", rect_is_clipped); |
73 | 72 |
74 MathUtil::AddToTracedValue("content_space_opaque_rect", opaque_rect, value); | 73 MathUtil::AddToTracedValue("content_space_opaque_rect", opaque_rect, value); |
75 | 74 |
76 bool opaque_rect_is_clipped; | 75 bool opaque_rect_is_clipped; |
77 gfx::QuadF opaque_rect_as_target_space_quad = MathUtil::MapQuad( | 76 gfx::QuadF opaque_rect_as_target_space_quad = |
78 shared_quad_state->content_to_target_transform, | 77 MathUtil::MapQuad(shared_quad_state->quad_to_target_transform, |
79 gfx::QuadF(opaque_rect), | 78 gfx::QuadF(opaque_rect), &opaque_rect_is_clipped); |
80 &opaque_rect_is_clipped); | |
81 MathUtil::AddToTracedValue("opaque_rect_as_target_space_quad", | 79 MathUtil::AddToTracedValue("opaque_rect_as_target_space_quad", |
82 opaque_rect_as_target_space_quad, value); | 80 opaque_rect_as_target_space_quad, value); |
83 | 81 |
84 value->SetBoolean("opaque_rect_is_clipped", opaque_rect_is_clipped); | 82 value->SetBoolean("opaque_rect_is_clipped", opaque_rect_is_clipped); |
85 | 83 |
86 MathUtil::AddToTracedValue("content_space_visible_rect", visible_rect, value); | 84 MathUtil::AddToTracedValue("content_space_visible_rect", visible_rect, value); |
87 | 85 |
88 bool visible_rect_is_clipped; | 86 bool visible_rect_is_clipped; |
89 gfx::QuadF visible_rect_as_target_space_quad = MathUtil::MapQuad( | 87 gfx::QuadF visible_rect_as_target_space_quad = |
90 shared_quad_state->content_to_target_transform, | 88 MathUtil::MapQuad(shared_quad_state->quad_to_target_transform, |
91 gfx::QuadF(visible_rect), | 89 gfx::QuadF(visible_rect), &visible_rect_is_clipped); |
92 &visible_rect_is_clipped); | |
93 | 90 |
94 MathUtil::AddToTracedValue("visible_rect_as_target_space_quad", | 91 MathUtil::AddToTracedValue("visible_rect_as_target_space_quad", |
95 visible_rect_as_target_space_quad, value); | 92 visible_rect_as_target_space_quad, value); |
96 | 93 |
97 value->SetBoolean("visible_rect_is_clipped", visible_rect_is_clipped); | 94 value->SetBoolean("visible_rect_is_clipped", visible_rect_is_clipped); |
98 | 95 |
99 value->SetBoolean("needs_blending", needs_blending); | 96 value->SetBoolean("needs_blending", needs_blending); |
100 value->SetBoolean("should_draw_with_blending", ShouldDrawWithBlending()); | 97 value->SetBoolean("should_draw_with_blending", ShouldDrawWithBlending()); |
101 ExtendValue(value); | 98 ExtendValue(value); |
102 } | 99 } |
103 | 100 |
104 DrawQuad::Resources::Resources() : count(0) { | 101 DrawQuad::Resources::Resources() : count(0) { |
105 for (size_t i = 0; i < kMaxResourceIdCount; ++i) | 102 for (size_t i = 0; i < kMaxResourceIdCount; ++i) |
106 ids[i] = 0; | 103 ids[i] = 0; |
107 } | 104 } |
108 | 105 |
109 } // namespace cc | 106 } // namespace cc |
OLD | NEW |