| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/overlay_strategy_common.h" | 5 #include "cc/output/overlay_strategy_common.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "cc/quads/solid_color_draw_quad.h" | 9 #include "cc/quads/solid_color_draw_quad.h" |
| 10 #include "cc/quads/stream_video_draw_quad.h" | 10 #include "cc/quads/stream_video_draw_quad.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 float alpha = (SkColorGetA(color) * (1.0f / 255.0f)) * opacity; | 49 float alpha = (SkColorGetA(color) * (1.0f / 255.0f)) * opacity; |
| 50 return solid_quad->ShouldDrawWithBlending() && | 50 return solid_quad->ShouldDrawWithBlending() && |
| 51 alpha < std::numeric_limits<float>::epsilon(); | 51 alpha < std::numeric_limits<float>::epsilon(); |
| 52 } | 52 } |
| 53 return false; | 53 return false; |
| 54 } | 54 } |
| 55 | 55 |
| 56 bool OverlayStrategyCommon::GetTextureQuadInfo(const TextureDrawQuad& quad, | 56 bool OverlayStrategyCommon::GetTextureQuadInfo(const TextureDrawQuad& quad, |
| 57 OverlayCandidate* quad_info) { | 57 OverlayCandidate* quad_info) { |
| 58 gfx::OverlayTransform overlay_transform = | 58 gfx::OverlayTransform overlay_transform = |
| 59 OverlayCandidate::GetOverlayTransform(quad.quadTransform(), quad.flipped); | 59 OverlayCandidate::GetOverlayTransform(quad.quadTransform(), |
| 60 quad.y_flipped); |
| 60 if (quad.background_color != SK_ColorTRANSPARENT || | 61 if (quad.background_color != SK_ColorTRANSPARENT || |
| 61 quad.premultiplied_alpha || | 62 quad.premultiplied_alpha || |
| 62 overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID) | 63 overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID) |
| 63 return false; | 64 return false; |
| 64 quad_info->resource_id = quad.resource_id; | 65 quad_info->resource_id = quad.resource_id; |
| 65 quad_info->transform = overlay_transform; | 66 quad_info->transform = overlay_transform; |
| 66 quad_info->uv_rect = BoundingRect(quad.uv_top_left, quad.uv_bottom_right); | 67 quad_info->uv_rect = BoundingRect(quad.uv_top_left, quad.uv_bottom_right); |
| 67 return true; | 68 return true; |
| 68 } | 69 } |
| 69 | 70 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 return false; | 127 return false; |
| 127 } | 128 } |
| 128 | 129 |
| 129 quad_info->format = RGBA_8888; | 130 quad_info->format = RGBA_8888; |
| 130 quad_info->display_rect = OverlayCandidate::GetOverlayRect( | 131 quad_info->display_rect = OverlayCandidate::GetOverlayRect( |
| 131 draw_quad.quadTransform(), draw_quad.rect); | 132 draw_quad.quadTransform(), draw_quad.rect); |
| 132 return true; | 133 return true; |
| 133 } | 134 } |
| 134 | 135 |
| 135 } // namespace cc | 136 } // namespace cc |
| OLD | NEW |