| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/render_pass_draw_quad.h" | 5 #include "cc/quads/render_pass_draw_quad.h" |
| 6 | 6 |
| 7 #include "base/trace_event/trace_event_argument.h" | 7 #include "base/trace_event/trace_event_argument.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" |
| 11 #include "third_party/skia/include/core/SkImageFilter.h" | 11 #include "third_party/skia/include/core/SkImageFilter.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 | 14 |
| 15 RenderPassDrawQuad::RenderPassDrawQuad() | 15 RenderPassDrawQuad::RenderPassDrawQuad() |
| 16 : render_pass_id(RenderPassId(-1, -1)), | 16 : mask_resource_id(static_cast<ResourceId>(-1)) { |
| 17 mask_resource_id(static_cast<ResourceId>(-1)) { | |
| 18 } | 17 } |
| 19 | 18 |
| 20 RenderPassDrawQuad::~RenderPassDrawQuad() { | 19 RenderPassDrawQuad::~RenderPassDrawQuad() { |
| 21 } | 20 } |
| 22 | 21 |
| 23 void RenderPassDrawQuad::SetNew(const SharedQuadState* shared_quad_state, | 22 void RenderPassDrawQuad::SetNew(const SharedQuadState* shared_quad_state, |
| 24 const gfx::Rect& rect, | 23 const gfx::Rect& rect, |
| 25 const gfx::Rect& visible_rect, | 24 const gfx::Rect& visible_rect, |
| 26 RenderPassId render_pass_id, | 25 RenderPassId render_pass_id, |
| 27 ResourceId mask_resource_id, | 26 ResourceId mask_resource_id, |
| 28 const gfx::Vector2dF& mask_uv_scale, | 27 const gfx::Vector2dF& mask_uv_scale, |
| 29 const gfx::Size& mask_texture_size, | 28 const gfx::Size& mask_texture_size, |
| 30 const FilterOperations& filters, | 29 const FilterOperations& filters, |
| 31 const gfx::Vector2dF& filters_scale, | 30 const gfx::Vector2dF& filters_scale, |
| 32 const FilterOperations& background_filters) { | 31 const FilterOperations& background_filters) { |
| 33 DCHECK_GT(render_pass_id.layer_id, 0); | 32 DCHECK_GT(render_pass_id.layer_id, 0); |
| 34 DCHECK_GE(render_pass_id.index, 0); | |
| 35 | 33 |
| 36 gfx::Rect opaque_rect; | 34 gfx::Rect opaque_rect; |
| 37 bool needs_blending = false; | 35 bool needs_blending = false; |
| 38 SetAll(shared_quad_state, | 36 SetAll(shared_quad_state, |
| 39 rect, | 37 rect, |
| 40 opaque_rect, | 38 opaque_rect, |
| 41 visible_rect, | 39 visible_rect, |
| 42 needs_blending, | 40 needs_blending, |
| 43 render_pass_id, | 41 render_pass_id, |
| 44 mask_resource_id, | 42 mask_resource_id, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 55 const gfx::Rect& visible_rect, | 53 const gfx::Rect& visible_rect, |
| 56 bool needs_blending, | 54 bool needs_blending, |
| 57 RenderPassId render_pass_id, | 55 RenderPassId render_pass_id, |
| 58 ResourceId mask_resource_id, | 56 ResourceId mask_resource_id, |
| 59 const gfx::Vector2dF& mask_uv_scale, | 57 const gfx::Vector2dF& mask_uv_scale, |
| 60 const gfx::Size& mask_texture_size, | 58 const gfx::Size& mask_texture_size, |
| 61 const FilterOperations& filters, | 59 const FilterOperations& filters, |
| 62 const gfx::Vector2dF& filters_scale, | 60 const gfx::Vector2dF& filters_scale, |
| 63 const FilterOperations& background_filters) { | 61 const FilterOperations& background_filters) { |
| 64 DCHECK_GT(render_pass_id.layer_id, 0); | 62 DCHECK_GT(render_pass_id.layer_id, 0); |
| 65 DCHECK_GE(render_pass_id.index, 0); | |
| 66 | 63 |
| 67 DrawQuad::SetAll(shared_quad_state, DrawQuad::RENDER_PASS, rect, opaque_rect, | 64 DrawQuad::SetAll(shared_quad_state, DrawQuad::RENDER_PASS, rect, opaque_rect, |
| 68 visible_rect, needs_blending); | 65 visible_rect, needs_blending); |
| 69 this->render_pass_id = render_pass_id; | 66 this->render_pass_id = render_pass_id; |
| 70 this->mask_resource_id = mask_resource_id; | 67 this->mask_resource_id = mask_resource_id; |
| 71 this->mask_uv_scale = mask_uv_scale; | 68 this->mask_uv_scale = mask_uv_scale; |
| 72 this->mask_texture_size = mask_texture_size; | 69 this->mask_texture_size = mask_texture_size; |
| 73 this->filters = filters; | 70 this->filters = filters; |
| 74 this->filters_scale = filters_scale; | 71 this->filters_scale = filters_scale; |
| 75 this->background_filters = background_filters; | 72 this->background_filters = background_filters; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 106 filters.AsValueInto(value); | 103 filters.AsValueInto(value); |
| 107 value->EndDictionary(); | 104 value->EndDictionary(); |
| 108 MathUtil::AddToTracedValue("filters_scale", filters_scale, value); | 105 MathUtil::AddToTracedValue("filters_scale", filters_scale, value); |
| 109 | 106 |
| 110 value->BeginDictionary("background_filters"); | 107 value->BeginDictionary("background_filters"); |
| 111 background_filters.AsValueInto(value); | 108 background_filters.AsValueInto(value); |
| 112 value->EndDictionary(); | 109 value->EndDictionary(); |
| 113 } | 110 } |
| 114 | 111 |
| 115 } // namespace cc | 112 } // namespace cc |
| OLD | NEW |