| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 return false; | 288 return false; |
| 289 gfx::OverlayTransform overlay_transform = GetOverlayTransform( | 289 gfx::OverlayTransform overlay_transform = GetOverlayTransform( |
| 290 quad->shared_quad_state->quad_to_target_transform, false); | 290 quad->shared_quad_state->quad_to_target_transform, false); |
| 291 if (overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID) | 291 if (overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID) |
| 292 return false; | 292 return false; |
| 293 if (!quad->matrix.IsScaleOrTranslation()) { | 293 if (!quad->matrix.IsScaleOrTranslation()) { |
| 294 // We cannot handle anything other than scaling & translation for texture | 294 // We cannot handle anything other than scaling & translation for texture |
| 295 // coordinates yet. | 295 // coordinates yet. |
| 296 return false; | 296 return false; |
| 297 } | 297 } |
| 298 candidate->format = quad->format; |
| 298 candidate->resource_id = quad->resource_id(); | 299 candidate->resource_id = quad->resource_id(); |
| 299 candidate->resource_size_in_pixels = quad->resource_size_in_pixels(); | 300 candidate->resource_size_in_pixels = quad->resource_size_in_pixels(); |
| 300 candidate->transform = overlay_transform; | 301 candidate->transform = overlay_transform; |
| 301 #if defined(OS_ANDROID) | 302 #if defined(OS_ANDROID) |
| 302 candidate->is_backed_by_surface_texture = | 303 candidate->is_backed_by_surface_texture = |
| 303 resource_provider->IsBackedBySurfaceTexture(quad->resource_id()); | 304 resource_provider->IsBackedBySurfaceTexture(quad->resource_id()); |
| 304 #endif | 305 #endif |
| 305 | 306 |
| 306 gfx::Point3F uv0 = gfx::Point3F(0, 0, 0); | 307 gfx::Point3F uv0 = gfx::Point3F(0, 0, 0); |
| 307 gfx::Point3F uv1 = gfx::Point3F(1, 1, 0); | 308 gfx::Point3F uv1 = gfx::Point3F(1, 1, 0); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 346 |
| 346 OverlayCandidateList& OverlayCandidateList::operator=( | 347 OverlayCandidateList& OverlayCandidateList::operator=( |
| 347 OverlayCandidateList&& other) = default; | 348 OverlayCandidateList&& other) = default; |
| 348 | 349 |
| 349 void OverlayCandidateList::AddPromotionHint(const OverlayCandidate& candidate) { | 350 void OverlayCandidateList::AddPromotionHint(const OverlayCandidate& candidate) { |
| 350 promotion_hint_info_map_[candidate.resource_id] = | 351 promotion_hint_info_map_[candidate.resource_id] = |
| 351 candidate.display_rect.origin(); | 352 candidate.display_rect.origin(); |
| 352 } | 353 } |
| 353 | 354 |
| 354 } // namespace cc | 355 } // namespace cc |
| OLD | NEW |