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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 } // namespace | 172 } // namespace |
173 | 173 |
174 OverlayCandidate::OverlayCandidate() | 174 OverlayCandidate::OverlayCandidate() |
175 : transform(gfx::OVERLAY_TRANSFORM_NONE), | 175 : transform(gfx::OVERLAY_TRANSFORM_NONE), |
176 format(gfx::BufferFormat::RGBA_8888), | 176 format(gfx::BufferFormat::RGBA_8888), |
177 uv_rect(0.f, 0.f, 1.f, 1.f), | 177 uv_rect(0.f, 0.f, 1.f, 1.f), |
178 is_clipped(false), | 178 is_clipped(false), |
| 179 is_opaque(false), |
179 use_output_surface_for_resource(false), | 180 use_output_surface_for_resource(false), |
180 resource_id(0), | 181 resource_id(0), |
181 #if defined(OS_ANDROID) | 182 #if defined(OS_ANDROID) |
182 is_backed_by_surface_texture(false), | 183 is_backed_by_surface_texture(false), |
183 is_promotable_hint(false), | 184 is_promotable_hint(false), |
184 #endif | 185 #endif |
185 plane_z_order(0), | 186 plane_z_order(0), |
186 is_unoccluded(false), | 187 is_unoccluded(false), |
187 overlay_handled(false) { | 188 overlay_handled(false) { |
188 } | 189 } |
(...skipping 15 matching lines...) Expand all Loading... |
204 return false; | 205 return false; |
205 | 206 |
206 auto& transform = quad->shared_quad_state->quad_to_target_transform; | 207 auto& transform = quad->shared_quad_state->quad_to_target_transform; |
207 candidate->display_rect = gfx::RectF(quad->rect); | 208 candidate->display_rect = gfx::RectF(quad->rect); |
208 transform.TransformRect(&candidate->display_rect); | 209 transform.TransformRect(&candidate->display_rect); |
209 candidate->quad_rect_in_target_space = | 210 candidate->quad_rect_in_target_space = |
210 MathUtil::MapEnclosingClippedRect(transform, quad->rect); | 211 MathUtil::MapEnclosingClippedRect(transform, quad->rect); |
211 | 212 |
212 candidate->clip_rect = quad->shared_quad_state->clip_rect; | 213 candidate->clip_rect = quad->shared_quad_state->clip_rect; |
213 candidate->is_clipped = quad->shared_quad_state->is_clipped; | 214 candidate->is_clipped = quad->shared_quad_state->is_clipped; |
| 215 candidate->is_opaque = !quad->ShouldDrawWithBlending(); |
214 | 216 |
215 switch (quad->material) { | 217 switch (quad->material) { |
216 case DrawQuad::TEXTURE_CONTENT: | 218 case DrawQuad::TEXTURE_CONTENT: |
217 return FromTextureQuad(resource_provider, | 219 return FromTextureQuad(resource_provider, |
218 TextureDrawQuad::MaterialCast(quad), candidate); | 220 TextureDrawQuad::MaterialCast(quad), candidate); |
219 case DrawQuad::STREAM_VIDEO_CONTENT: | 221 case DrawQuad::STREAM_VIDEO_CONTENT: |
220 return FromStreamVideoQuad(resource_provider, | 222 return FromStreamVideoQuad(resource_provider, |
221 StreamVideoDrawQuad::MaterialCast(quad), | 223 StreamVideoDrawQuad::MaterialCast(quad), |
222 candidate); | 224 candidate); |
223 default: | 225 default: |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 | 347 |
346 OverlayCandidateList& OverlayCandidateList::operator=( | 348 OverlayCandidateList& OverlayCandidateList::operator=( |
347 OverlayCandidateList&& other) = default; | 349 OverlayCandidateList&& other) = default; |
348 | 350 |
349 void OverlayCandidateList::AddPromotionHint(const OverlayCandidate& candidate) { | 351 void OverlayCandidateList::AddPromotionHint(const OverlayCandidate& candidate) { |
350 promotion_hint_info_map_[candidate.resource_id] = | 352 promotion_hint_info_map_[candidate.resource_id] = |
351 candidate.display_rect.origin(); | 353 candidate.display_rect.origin(); |
352 } | 354 } |
353 | 355 |
354 } // namespace cc | 356 } // namespace cc |
OLD | NEW |