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