| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/output/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 return true; | 65 return true; |
| 66 #else | 66 #else |
| 67 return false; | 67 return false; |
| 68 #endif | 68 #endif |
| 69 } | 69 } |
| 70 | 70 |
| 71 Float4 UVTransform(const TextureDrawQuad* quad) { | 71 Float4 UVTransform(const TextureDrawQuad* quad) { |
| 72 gfx::PointF uv0 = quad->uv_top_left; | 72 gfx::PointF uv0 = quad->uv_top_left; |
| 73 gfx::PointF uv1 = quad->uv_bottom_right; | 73 gfx::PointF uv1 = quad->uv_bottom_right; |
| 74 Float4 xform = {{uv0.x(), uv0.y(), uv1.x() - uv0.x(), uv1.y() - uv0.y()}}; | 74 Float4 xform = {{uv0.x(), uv0.y(), uv1.x() - uv0.x(), uv1.y() - uv0.y()}}; |
| 75 if (quad->flipped) { | 75 if (quad->y_flipped) { |
| 76 xform.data[1] = 1.0f - xform.data[1]; | 76 xform.data[1] = 1.0f - xform.data[1]; |
| 77 xform.data[3] = -xform.data[3]; | 77 xform.data[3] = -xform.data[3]; |
| 78 } | 78 } |
| 79 return xform; | 79 return xform; |
| 80 } | 80 } |
| 81 | 81 |
| 82 Float4 PremultipliedColor(SkColor color) { | 82 Float4 PremultipliedColor(SkColor color) { |
| 83 const float factor = 1.0f / 255.0f; | 83 const float factor = 1.0f / 255.0f; |
| 84 const float alpha = SkColorGetA(color) * factor; | 84 const float alpha = SkColorGetA(color) * factor; |
| 85 | 85 |
| (...skipping 3349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3435 context_support_->ScheduleOverlayPlane( | 3435 context_support_->ScheduleOverlayPlane( |
| 3436 overlay.plane_z_order, | 3436 overlay.plane_z_order, |
| 3437 overlay.transform, | 3437 overlay.transform, |
| 3438 pending_overlay_resources_.back()->texture_id(), | 3438 pending_overlay_resources_.back()->texture_id(), |
| 3439 ToNearestRect(overlay.display_rect), | 3439 ToNearestRect(overlay.display_rect), |
| 3440 overlay.uv_rect); | 3440 overlay.uv_rect); |
| 3441 } | 3441 } |
| 3442 } | 3442 } |
| 3443 | 3443 |
| 3444 } // namespace cc | 3444 } // namespace cc |
| OLD | NEW |