OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_candidate.h" | 5 #include "cc/output/overlay_candidate.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 189 |
190 auto& transform = quad->shared_quad_state->quad_to_target_transform; | 190 auto& transform = quad->shared_quad_state->quad_to_target_transform; |
191 candidate->display_rect = gfx::RectF(quad->rect); | 191 candidate->display_rect = gfx::RectF(quad->rect); |
192 transform.TransformRect(&candidate->display_rect); | 192 transform.TransformRect(&candidate->display_rect); |
193 candidate->quad_rect_in_target_space = | 193 candidate->quad_rect_in_target_space = |
194 MathUtil::MapEnclosingClippedRect(transform, quad->rect); | 194 MathUtil::MapEnclosingClippedRect(transform, quad->rect); |
195 | 195 |
196 candidate->format = RGBA_8888; | 196 candidate->format = RGBA_8888; |
197 candidate->clip_rect = quad->shared_quad_state->clip_rect; | 197 candidate->clip_rect = quad->shared_quad_state->clip_rect; |
198 candidate->is_clipped = quad->shared_quad_state->is_clipped; | 198 candidate->is_clipped = quad->shared_quad_state->is_clipped; |
199 candidate->needs_blending = | |
200 quad->shared_quad_state->opacity < 1.0f || quad->needs_blending; | |
201 | 199 |
202 switch (quad->material) { | 200 switch (quad->material) { |
203 case DrawQuad::TEXTURE_CONTENT: | 201 case DrawQuad::TEXTURE_CONTENT: |
204 return FromTextureQuad(resource_provider, | 202 return FromTextureQuad(resource_provider, |
205 TextureDrawQuad::MaterialCast(quad), candidate); | 203 TextureDrawQuad::MaterialCast(quad), candidate); |
206 case DrawQuad::STREAM_VIDEO_CONTENT: | 204 case DrawQuad::STREAM_VIDEO_CONTENT: |
207 return FromStreamVideoQuad(resource_provider, | 205 return FromStreamVideoQuad(resource_provider, |
208 StreamVideoDrawQuad::MaterialCast(quad), | 206 StreamVideoDrawQuad::MaterialCast(quad), |
209 candidate); | 207 candidate); |
210 case DrawQuad::IO_SURFACE_CONTENT: | 208 case DrawQuad::IO_SURFACE_CONTENT: |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 if (overlay_transform != gfx::OVERLAY_TRANSFORM_NONE) | 303 if (overlay_transform != gfx::OVERLAY_TRANSFORM_NONE) |
306 return false; | 304 return false; |
307 candidate->resource_id = quad->io_surface_resource_id(); | 305 candidate->resource_id = quad->io_surface_resource_id(); |
308 candidate->resource_size_in_pixels = quad->io_surface_size; | 306 candidate->resource_size_in_pixels = quad->io_surface_size; |
309 candidate->transform = overlay_transform; | 307 candidate->transform = overlay_transform; |
310 candidate->uv_rect = gfx::RectF(1.f, 1.f); | 308 candidate->uv_rect = gfx::RectF(1.f, 1.f); |
311 return true; | 309 return true; |
312 } | 310 } |
313 | 311 |
314 } // namespace cc | 312 } // namespace cc |
OLD | NEW |