| 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/io_surface_draw_quad.h" | 9 #include "cc/quads/io_surface_draw_quad.h" |
| 10 #include "cc/quads/solid_color_draw_quad.h" | 10 #include "cc/quads/solid_color_draw_quad.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 bool OverlayStrategyCommon::GetIOSurfaceQuadInfo(const IOSurfaceDrawQuad& quad, | 133 bool OverlayStrategyCommon::GetIOSurfaceQuadInfo(const IOSurfaceDrawQuad& quad, |
| 134 OverlayCandidate* quad_info) { | 134 OverlayCandidate* quad_info) { |
| 135 gfx::OverlayTransform overlay_transform = | 135 gfx::OverlayTransform overlay_transform = |
| 136 OverlayCandidate::GetOverlayTransform( | 136 OverlayCandidate::GetOverlayTransform( |
| 137 quad.shared_quad_state->quad_to_target_transform, false); | 137 quad.shared_quad_state->quad_to_target_transform, false); |
| 138 if (overlay_transform != gfx::OVERLAY_TRANSFORM_NONE) | 138 if (overlay_transform != gfx::OVERLAY_TRANSFORM_NONE) |
| 139 return false; | 139 return false; |
| 140 quad_info->resource_id = quad.io_surface_resource_id(); | 140 quad_info->resource_id = quad.io_surface_resource_id(); |
| 141 quad_info->resource_size_in_pixels = quad.io_surface_size; | 141 quad_info->resource_size_in_pixels = quad.io_surface_size; |
| 142 quad_info->transform = overlay_transform; | 142 quad_info->transform = overlay_transform; |
| 143 quad_info->uv_rect = gfx::Rect(0, 0, 1, 1); | 143 quad_info->uv_rect = gfx::RectF(1.f, 1.f); |
| 144 return true; | 144 return true; |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool OverlayStrategyCommon::GetCandidateQuadInfo(const DrawQuad& draw_quad, | 147 bool OverlayStrategyCommon::GetCandidateQuadInfo(const DrawQuad& draw_quad, |
| 148 OverlayCandidate* quad_info) { | 148 OverlayCandidate* quad_info) { |
| 149 // All quad checks. | 149 // All quad checks. |
| 150 if (draw_quad.needs_blending || draw_quad.shared_quad_state->opacity != 1.f || | 150 if (draw_quad.needs_blending || draw_quad.shared_quad_state->opacity != 1.f || |
| 151 draw_quad.shared_quad_state->blend_mode != SkXfermode::kSrcOver_Mode) | 151 draw_quad.shared_quad_state->blend_mode != SkXfermode::kSrcOver_Mode) |
| 152 return false; | 152 return false; |
| 153 | 153 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 171 return false; | 171 return false; |
| 172 } | 172 } |
| 173 | 173 |
| 174 quad_info->format = RGBA_8888; | 174 quad_info->format = RGBA_8888; |
| 175 quad_info->display_rect = OverlayCandidate::GetOverlayRect( | 175 quad_info->display_rect = OverlayCandidate::GetOverlayRect( |
| 176 draw_quad.shared_quad_state->quad_to_target_transform, draw_quad.rect); | 176 draw_quad.shared_quad_state->quad_to_target_transform, draw_quad.rect); |
| 177 return true; | 177 return true; |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace cc | 180 } // namespace cc |
| OLD | NEW |