| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 } | 183 } |
| 184 | 184 |
| 185 OverlayCandidate::OverlayCandidate(const OverlayCandidate& other) = default; | 185 OverlayCandidate::OverlayCandidate(const OverlayCandidate& other) = default; |
| 186 | 186 |
| 187 OverlayCandidate::~OverlayCandidate() {} | 187 OverlayCandidate::~OverlayCandidate() {} |
| 188 | 188 |
| 189 // static | 189 // static |
| 190 bool OverlayCandidate::FromDrawQuad(ResourceProvider* resource_provider, | 190 bool OverlayCandidate::FromDrawQuad(ResourceProvider* resource_provider, |
| 191 const DrawQuad* quad, | 191 const DrawQuad* quad, |
| 192 OverlayCandidate* candidate) { | 192 OverlayCandidate* candidate) { |
| 193 if (quad->ShouldDrawWithBlending() || | 193 if (quad->shared_quad_state->blend_mode != SkBlendMode::kSrcOver) |
| 194 quad->shared_quad_state->opacity != 1.f || | |
| 195 quad->shared_quad_state->blend_mode != SkBlendMode::kSrcOver) | |
| 196 return false; | 194 return false; |
| 197 | 195 |
| 198 auto& transform = quad->shared_quad_state->quad_to_target_transform; | 196 auto& transform = quad->shared_quad_state->quad_to_target_transform; |
| 199 candidate->display_rect = gfx::RectF(quad->rect); | 197 candidate->display_rect = gfx::RectF(quad->rect); |
| 200 transform.TransformRect(&candidate->display_rect); | 198 transform.TransformRect(&candidate->display_rect); |
| 201 candidate->quad_rect_in_target_space = | 199 candidate->quad_rect_in_target_space = |
| 202 MathUtil::MapEnclosingClippedRect(transform, quad->rect); | 200 MathUtil::MapEnclosingClippedRect(transform, quad->rect); |
| 203 | 201 |
| 204 candidate->format = RGBA_8888; | 202 candidate->format = RGBA_8888; |
| 205 candidate->clip_rect = quad->shared_quad_state->clip_rect; | 203 candidate->clip_rect = quad->shared_quad_state->clip_rect; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 | 332 |
| 335 OverlayCandidateList& OverlayCandidateList::operator=( | 333 OverlayCandidateList& OverlayCandidateList::operator=( |
| 336 OverlayCandidateList&& other) = default; | 334 OverlayCandidateList&& other) = default; |
| 337 | 335 |
| 338 void OverlayCandidateList::AddPromotionHint(const OverlayCandidate& candidate) { | 336 void OverlayCandidateList::AddPromotionHint(const OverlayCandidate& candidate) { |
| 339 promotion_hint_info_map_[candidate.resource_id] = | 337 promotion_hint_info_map_[candidate.resource_id] = |
| 340 candidate.display_rect.origin(); | 338 candidate.display_rect.origin(); |
| 341 } | 339 } |
| 342 | 340 |
| 343 } // namespace cc | 341 } // namespace cc |
| OLD | NEW |