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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 OverlayCandidate::OverlayCandidate(const OverlayCandidate& other) = default; | 180 OverlayCandidate::OverlayCandidate(const OverlayCandidate& other) = default; |
181 | 181 |
182 OverlayCandidate::~OverlayCandidate() {} | 182 OverlayCandidate::~OverlayCandidate() {} |
183 | 183 |
184 // static | 184 // static |
185 bool OverlayCandidate::FromDrawQuad(ResourceProvider* resource_provider, | 185 bool OverlayCandidate::FromDrawQuad(ResourceProvider* resource_provider, |
186 const DrawQuad* quad, | 186 const DrawQuad* quad, |
187 OverlayCandidate* candidate) { | 187 OverlayCandidate* candidate) { |
188 if (quad->ShouldDrawWithBlending() || | 188 if (quad->ShouldDrawWithBlending() || |
189 quad->shared_quad_state->opacity != 1.f || | 189 quad->shared_quad_state->opacity != 1.f || |
190 quad->shared_quad_state->blend_mode != SkXfermode::kSrcOver_Mode) | 190 quad->shared_quad_state->blend_mode != SkBlendMode::kSrcOver) |
191 return false; | 191 return false; |
192 | 192 |
193 auto& transform = quad->shared_quad_state->quad_to_target_transform; | 193 auto& transform = quad->shared_quad_state->quad_to_target_transform; |
194 candidate->display_rect = gfx::RectF(quad->rect); | 194 candidate->display_rect = gfx::RectF(quad->rect); |
195 transform.TransformRect(&candidate->display_rect); | 195 transform.TransformRect(&candidate->display_rect); |
196 candidate->quad_rect_in_target_space = | 196 candidate->quad_rect_in_target_space = |
197 MathUtil::MapEnclosingClippedRect(transform, quad->rect); | 197 MathUtil::MapEnclosingClippedRect(transform, quad->rect); |
198 | 198 |
199 candidate->format = RGBA_8888; | 199 candidate->format = RGBA_8888; |
200 candidate->clip_rect = quad->shared_quad_state->clip_rect; | 200 candidate->clip_rect = quad->shared_quad_state->clip_rect; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 candidate->uv_rect = gfx::RectF(uv0.x(), uv1.y(), delta.x(), -delta.y()); | 304 candidate->uv_rect = gfx::RectF(uv0.x(), uv1.y(), delta.x(), -delta.y()); |
305 } else { | 305 } else { |
306 candidate->transform = ComposeTransforms( | 306 candidate->transform = ComposeTransforms( |
307 gfx::OVERLAY_TRANSFORM_FLIP_VERTICAL, candidate->transform); | 307 gfx::OVERLAY_TRANSFORM_FLIP_VERTICAL, candidate->transform); |
308 candidate->uv_rect = gfx::RectF(uv0.x(), uv0.y(), delta.x(), delta.y()); | 308 candidate->uv_rect = gfx::RectF(uv0.x(), uv0.y(), delta.x(), delta.y()); |
309 } | 309 } |
310 return true; | 310 return true; |
311 } | 311 } |
312 | 312 |
313 } // namespace cc | 313 } // namespace cc |
OLD | NEW |