Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: cc/output/overlay_candidate.cc

Issue 208213003: Plumb overlay processing into DirectRenderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More plumbing Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_validator.h" 5 #include "cc/output/overlay_candidate.h"
6
7 #include "ui/gfx/rect_conversions.h"
6 8
7 namespace cc { 9 namespace cc {
8 10
9 OverlayCandidate::OverlayCandidate() 11 OverlayCandidate::OverlayCandidate()
10 : transform(NONE), 12 : transform(NONE),
11 format(RGBA_8888), 13 format(RGBA_8888),
12 uv_rect(0.f, 0.f, 1.f, 1.f), 14 uv_rect(0.f, 0.f, 1.f, 1.f),
13 overlay_handled(false) {} 15 overlay_handled(false) {}
14 16
15 OverlayCandidate::~OverlayCandidate() {} 17 OverlayCandidate::~OverlayCandidate() {}
16 18
19 // static
20 OverlayCandidate::OverlayTransform OverlayCandidate::GetOverlayTransform(
21 const gfx::Transform& quad_transform,
22 bool flipped) {
23 if (!quad_transform.IsIdentityOrTranslation())
24 return INVALID;
25
26 return flipped ? FLIP_VERTICAL : NONE;
27 }
28
29 // static
30 gfx::Rect OverlayCandidate::GetOverlayRect(const gfx::Transform& quad_transform,
31 const gfx::Rect& rect) {
32 DCHECK(quad_transform.IsIdentityOrTranslation());
33
34 gfx::RectF float_rect(rect);
35 quad_transform.TransformRect(&float_rect);
36 return gfx::ToNearestRect(float_rect);
37 }
38
17 } // namespace cc 39 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698