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
3 // found in the LICENSE file.
5 #include "cc/output/overlay_candidate.h"
7 #include "ui/gfx/rect_conversions.h"
11 OverlayCandidate::OverlayCandidate()
14 uv_rect(0.f, 0.f, 1.f, 1.f),
17 overlay_handled(false) {}
19 OverlayCandidate::~OverlayCandidate() {}
22 OverlayCandidate::OverlayTransform OverlayCandidate::GetOverlayTransform(
23 const gfx::Transform& quad_transform,
25 if (!quad_transform.IsIdentityOrTranslation())
28 return flipped ? FLIP_VERTICAL : NONE;
32 gfx::Rect OverlayCandidate::GetOverlayRect(const gfx::Transform& quad_transform,
33 const gfx::Rect& rect) {
34 DCHECK(quad_transform.IsIdentityOrTranslation());
36 gfx::RectF float_rect(rect);
37 quad_transform.TransformRect(&float_rect);
38 return gfx::ToNearestRect(float_rect);