| 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/texture_draw_quad.h" | 5 #include "cc/quads/texture_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" |
| 11 #include "ui/gfx/geometry/vector2d_f.h" | 11 #include "ui/gfx/geometry/vector2d_f.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 | 14 |
| 15 TextureDrawQuad::TextureDrawQuad() | 15 TextureDrawQuad::TextureDrawQuad() |
| 16 : resource_id(0), | 16 : resource_id(0), |
| 17 allow_overlay(false), |
| 17 premultiplied_alpha(false), | 18 premultiplied_alpha(false), |
| 18 background_color(SK_ColorTRANSPARENT), | 19 background_color(SK_ColorTRANSPARENT), |
| 19 y_flipped(false), | 20 y_flipped(false), |
| 20 nearest_neighbor(false) { | 21 nearest_neighbor(false) { |
| 21 this->vertex_opacity[0] = 0.f; | 22 this->vertex_opacity[0] = 0.f; |
| 22 this->vertex_opacity[1] = 0.f; | 23 this->vertex_opacity[1] = 0.f; |
| 23 this->vertex_opacity[2] = 0.f; | 24 this->vertex_opacity[2] = 0.f; |
| 24 this->vertex_opacity[3] = 0.f; | 25 this->vertex_opacity[3] = 0.f; |
| 25 } | 26 } |
| 26 | 27 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 52 this->y_flipped = y_flipped; | 53 this->y_flipped = y_flipped; |
| 53 this->nearest_neighbor = nearest_neighbor; | 54 this->nearest_neighbor = nearest_neighbor; |
| 54 } | 55 } |
| 55 | 56 |
| 56 void TextureDrawQuad::SetAll(const SharedQuadState* shared_quad_state, | 57 void TextureDrawQuad::SetAll(const SharedQuadState* shared_quad_state, |
| 57 const gfx::Rect& rect, | 58 const gfx::Rect& rect, |
| 58 const gfx::Rect& opaque_rect, | 59 const gfx::Rect& opaque_rect, |
| 59 const gfx::Rect& visible_rect, | 60 const gfx::Rect& visible_rect, |
| 60 bool needs_blending, | 61 bool needs_blending, |
| 61 unsigned resource_id, | 62 unsigned resource_id, |
| 63 gfx::Size resource_size_in_pixels, |
| 64 bool allow_overlay, |
| 62 bool premultiplied_alpha, | 65 bool premultiplied_alpha, |
| 63 const gfx::PointF& uv_top_left, | 66 const gfx::PointF& uv_top_left, |
| 64 const gfx::PointF& uv_bottom_right, | 67 const gfx::PointF& uv_bottom_right, |
| 65 SkColor background_color, | 68 SkColor background_color, |
| 66 const float vertex_opacity[4], | 69 const float vertex_opacity[4], |
| 67 bool y_flipped, | 70 bool y_flipped, |
| 68 bool nearest_neighbor) { | 71 bool nearest_neighbor) { |
| 69 DrawQuad::SetAll(shared_quad_state, DrawQuad::TEXTURE_CONTENT, rect, | 72 DrawQuad::SetAll(shared_quad_state, DrawQuad::TEXTURE_CONTENT, rect, |
| 70 opaque_rect, visible_rect, needs_blending); | 73 opaque_rect, visible_rect, needs_blending); |
| 71 this->resource_id = resource_id; | 74 this->resource_id = resource_id; |
| 75 this->resource_size_in_pixels = resource_size_in_pixels; |
| 76 this->allow_overlay = allow_overlay; |
| 72 this->premultiplied_alpha = premultiplied_alpha; | 77 this->premultiplied_alpha = premultiplied_alpha; |
| 73 this->uv_top_left = uv_top_left; | 78 this->uv_top_left = uv_top_left; |
| 74 this->uv_bottom_right = uv_bottom_right; | 79 this->uv_bottom_right = uv_bottom_right; |
| 75 this->background_color = background_color; | 80 this->background_color = background_color; |
| 76 this->vertex_opacity[0] = vertex_opacity[0]; | 81 this->vertex_opacity[0] = vertex_opacity[0]; |
| 77 this->vertex_opacity[1] = vertex_opacity[1]; | 82 this->vertex_opacity[1] = vertex_opacity[1]; |
| 78 this->vertex_opacity[2] = vertex_opacity[2]; | 83 this->vertex_opacity[2] = vertex_opacity[2]; |
| 79 this->vertex_opacity[3] = vertex_opacity[3]; | 84 this->vertex_opacity[3] = vertex_opacity[3]; |
| 80 this->y_flipped = y_flipped; | 85 this->y_flipped = y_flipped; |
| 81 this->nearest_neighbor = nearest_neighbor; | 86 this->nearest_neighbor = nearest_neighbor; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 103 value->BeginArray("vertex_opacity"); | 108 value->BeginArray("vertex_opacity"); |
| 104 for (size_t i = 0; i < 4; ++i) | 109 for (size_t i = 0; i < 4; ++i) |
| 105 value->AppendDouble(vertex_opacity[i]); | 110 value->AppendDouble(vertex_opacity[i]); |
| 106 value->EndArray(); | 111 value->EndArray(); |
| 107 | 112 |
| 108 value->SetBoolean("y_flipped", y_flipped); | 113 value->SetBoolean("y_flipped", y_flipped); |
| 109 value->SetBoolean("nearest_neighbor", nearest_neighbor); | 114 value->SetBoolean("nearest_neighbor", nearest_neighbor); |
| 110 } | 115 } |
| 111 | 116 |
| 112 } // namespace cc | 117 } // namespace cc |
| OLD | NEW |