| 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" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 this->nearest_neighbor = nearest_neighbor; | 53 this->nearest_neighbor = nearest_neighbor; |
| 54 } | 54 } |
| 55 | 55 |
| 56 void TextureDrawQuad::SetAll(const SharedQuadState* shared_quad_state, | 56 void TextureDrawQuad::SetAll(const SharedQuadState* shared_quad_state, |
| 57 const gfx::Rect& rect, | 57 const gfx::Rect& rect, |
| 58 const gfx::Rect& opaque_rect, | 58 const gfx::Rect& opaque_rect, |
| 59 const gfx::Rect& visible_rect, | 59 const gfx::Rect& visible_rect, |
| 60 bool needs_blending, | 60 bool needs_blending, |
| 61 unsigned resource_id, | 61 unsigned resource_id, |
| 62 gfx::Size resource_size_in_pixels, | 62 gfx::Size resource_size_in_pixels, |
| 63 bool allow_overlay, | |
| 64 bool premultiplied_alpha, | 63 bool premultiplied_alpha, |
| 65 const gfx::PointF& uv_top_left, | 64 const gfx::PointF& uv_top_left, |
| 66 const gfx::PointF& uv_bottom_right, | 65 const gfx::PointF& uv_bottom_right, |
| 67 SkColor background_color, | 66 SkColor background_color, |
| 68 const float vertex_opacity[4], | 67 const float vertex_opacity[4], |
| 69 bool y_flipped, | 68 bool y_flipped, |
| 70 bool nearest_neighbor) { | 69 bool nearest_neighbor) { |
| 71 DrawQuad::SetAll(shared_quad_state, DrawQuad::TEXTURE_CONTENT, rect, | 70 DrawQuad::SetAll(shared_quad_state, DrawQuad::TEXTURE_CONTENT, rect, |
| 72 opaque_rect, visible_rect, needs_blending); | 71 opaque_rect, visible_rect, needs_blending); |
| 73 resources.ids[kResourceIdIndex] = resource_id; | 72 resources.ids[kResourceIdIndex] = resource_id; |
| 74 overlay_resources.size_in_pixels[kResourceIdIndex] = resource_size_in_pixels; | 73 overlay_resources.size_in_pixels[kResourceIdIndex] = resource_size_in_pixels; |
| 75 overlay_resources.allow_overlay[kResourceIdIndex] = allow_overlay; | |
| 76 resources.count = 1; | 74 resources.count = 1; |
| 77 this->premultiplied_alpha = premultiplied_alpha; | 75 this->premultiplied_alpha = premultiplied_alpha; |
| 78 this->uv_top_left = uv_top_left; | 76 this->uv_top_left = uv_top_left; |
| 79 this->uv_bottom_right = uv_bottom_right; | 77 this->uv_bottom_right = uv_bottom_right; |
| 80 this->background_color = background_color; | 78 this->background_color = background_color; |
| 81 this->vertex_opacity[0] = vertex_opacity[0]; | 79 this->vertex_opacity[0] = vertex_opacity[0]; |
| 82 this->vertex_opacity[1] = vertex_opacity[1]; | 80 this->vertex_opacity[1] = vertex_opacity[1]; |
| 83 this->vertex_opacity[2] = vertex_opacity[2]; | 81 this->vertex_opacity[2] = vertex_opacity[2]; |
| 84 this->vertex_opacity[3] = vertex_opacity[3]; | 82 this->vertex_opacity[3] = vertex_opacity[3]; |
| 85 this->y_flipped = y_flipped; | 83 this->y_flipped = y_flipped; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 103 value->BeginArray("vertex_opacity"); | 101 value->BeginArray("vertex_opacity"); |
| 104 for (size_t i = 0; i < 4; ++i) | 102 for (size_t i = 0; i < 4; ++i) |
| 105 value->AppendDouble(vertex_opacity[i]); | 103 value->AppendDouble(vertex_opacity[i]); |
| 106 value->EndArray(); | 104 value->EndArray(); |
| 107 | 105 |
| 108 value->SetBoolean("y_flipped", y_flipped); | 106 value->SetBoolean("y_flipped", y_flipped); |
| 109 value->SetBoolean("nearest_neighbor", nearest_neighbor); | 107 value->SetBoolean("nearest_neighbor", nearest_neighbor); |
| 110 } | 108 } |
| 111 | 109 |
| 112 TextureDrawQuad::OverlayResources::OverlayResources() { | 110 TextureDrawQuad::OverlayResources::OverlayResources() { |
| 113 for (size_t i = 0; i < Resources::kMaxResourceIdCount; ++i) | |
| 114 allow_overlay[i] = false; | |
| 115 } | 111 } |
| 116 | 112 |
| 117 } // namespace cc | 113 } // namespace cc |
| OLD | NEW |