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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 if (overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID) | 92 if (overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID) |
93 return false; | 93 return false; |
94 if (!quad.matrix.IsScaleOrTranslation()) { | 94 if (!quad.matrix.IsScaleOrTranslation()) { |
95 // We cannot handle anything other than scaling & translation for texture | 95 // We cannot handle anything other than scaling & translation for texture |
96 // coordinates yet. | 96 // coordinates yet. |
97 return false; | 97 return false; |
98 } | 98 } |
99 quad_info->resource_id = quad.resource_id(); | 99 quad_info->resource_id = quad.resource_id(); |
100 quad_info->resource_size_in_pixels = quad.resource_size_in_pixels(); | 100 quad_info->resource_size_in_pixels = quad.resource_size_in_pixels(); |
101 quad_info->transform = overlay_transform; | 101 quad_info->transform = overlay_transform; |
102 quad_info->geometry_rect = quad.rect; | |
103 quad.shared_quad_state->quad_to_target_transform.TransformRect( | |
danakj
2015/08/31 22:11:47
Please use MathUtil::MapEnclosingClippedRect inste
william.xie1
2015/09/01 03:40:33
Done.
| |
104 &quad_info->geometry_rect); | |
105 quad_info->clip_rect = quad.shared_quad_state->clip_rect; | |
106 quad_info->is_clipped = quad.shared_quad_state->is_clipped; | |
102 | 107 |
103 gfx::Point3F uv0 = gfx::Point3F(0, 0, 0); | 108 gfx::Point3F uv0 = gfx::Point3F(0, 0, 0); |
104 gfx::Point3F uv1 = gfx::Point3F(1, 1, 0); | 109 gfx::Point3F uv1 = gfx::Point3F(1, 1, 0); |
105 quad.matrix.TransformPoint(&uv0); | 110 quad.matrix.TransformPoint(&uv0); |
106 quad.matrix.TransformPoint(&uv1); | 111 quad.matrix.TransformPoint(&uv1); |
107 gfx::Vector3dF delta = uv1 - uv0; | 112 gfx::Vector3dF delta = uv1 - uv0; |
108 if (delta.x() < 0) { | 113 if (delta.x() < 0) { |
109 quad_info->transform = OverlayCandidate::ModifyTransform( | 114 quad_info->transform = OverlayCandidate::ModifyTransform( |
110 quad_info->transform, gfx::OVERLAY_TRANSFORM_FLIP_HORIZONTAL); | 115 quad_info->transform, gfx::OVERLAY_TRANSFORM_FLIP_HORIZONTAL); |
111 float x0 = uv0.x(); | 116 float x0 = uv0.x(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 return false; | 150 return false; |
146 } | 151 } |
147 | 152 |
148 quad_info->format = RGBA_8888; | 153 quad_info->format = RGBA_8888; |
149 quad_info->display_rect = OverlayCandidate::GetOverlayRect( | 154 quad_info->display_rect = OverlayCandidate::GetOverlayRect( |
150 draw_quad.shared_quad_state->quad_to_target_transform, draw_quad.rect); | 155 draw_quad.shared_quad_state->quad_to_target_transform, draw_quad.rect); |
151 return true; | 156 return true; |
152 } | 157 } |
153 | 158 |
154 } // namespace cc | 159 } // namespace cc |
OLD | NEW |