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

Side by Side Diff: cc/yuv_video_draw_quad.cc

Issue 11649005: cc: Support anti-aliasing for solid color layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and add DrawQuad::AntiAliasing struct. Created 7 years, 11 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/yuv_video_draw_quad.h" 5 #include "cc/yuv_video_draw_quad.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
11 YUVVideoDrawQuad::YUVVideoDrawQuad() {} 11 YUVVideoDrawQuad::YUVVideoDrawQuad() {}
12 YUVVideoDrawQuad::~YUVVideoDrawQuad() {} 12 YUVVideoDrawQuad::~YUVVideoDrawQuad() {}
13 13
14 scoped_ptr<YUVVideoDrawQuad> YUVVideoDrawQuad::Create() { 14 scoped_ptr<YUVVideoDrawQuad> YUVVideoDrawQuad::Create() {
15 return make_scoped_ptr(new YUVVideoDrawQuad); 15 return make_scoped_ptr(new YUVVideoDrawQuad);
16 } 16 }
17 17
18 void YUVVideoDrawQuad::SetNew(const SharedQuadState* shared_quad_state, 18 void YUVVideoDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
19 gfx::Rect rect, 19 gfx::Rect rect,
20 gfx::Rect opaque_rect, 20 gfx::Rect opaque_rect,
21 gfx::SizeF tex_scale, 21 gfx::SizeF tex_scale,
22 const VideoLayerImpl::FramePlane& y_plane, 22 const VideoLayerImpl::FramePlane& y_plane,
23 const VideoLayerImpl::FramePlane& u_plane, 23 const VideoLayerImpl::FramePlane& u_plane,
24 const VideoLayerImpl::FramePlane& v_plane) { 24 const VideoLayerImpl::FramePlane& v_plane) {
25 gfx::Rect visible_rect = rect; 25 gfx::Rect visible_rect = rect;
26 bool needs_blending = false; 26 bool needs_blending = false;
27 DrawQuad::SetAll(shared_quad_state, DrawQuad::YUV_VIDEO_CONTENT, rect, 27 DrawQuad::SetAll(shared_quad_state, DrawQuad::YUV_VIDEO_CONTENT, rect,
28 opaque_rect, visible_rect, needs_blending); 28 opaque_rect, visible_rect, needs_blending, AntiAliasing());
29 this->tex_scale = tex_scale; 29 this->tex_scale = tex_scale;
30 this->y_plane = y_plane; 30 this->y_plane = y_plane;
31 this->u_plane = u_plane; 31 this->u_plane = u_plane;
32 this->v_plane = v_plane; 32 this->v_plane = v_plane;
33 } 33 }
34 34
35 void YUVVideoDrawQuad::SetAll(const SharedQuadState* shared_quad_state, 35 void YUVVideoDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
36 gfx::Rect rect, 36 gfx::Rect rect,
37 gfx::Rect opaque_rect, 37 gfx::Rect opaque_rect,
38 gfx::Rect visible_rect, 38 gfx::Rect visible_rect,
39 bool needs_blending, 39 bool needs_blending,
40 gfx::SizeF tex_scale, 40 gfx::SizeF tex_scale,
41 const VideoLayerImpl::FramePlane& y_plane, 41 const VideoLayerImpl::FramePlane& y_plane,
42 const VideoLayerImpl::FramePlane& u_plane, 42 const VideoLayerImpl::FramePlane& u_plane,
43 const VideoLayerImpl::FramePlane& v_plane) { 43 const VideoLayerImpl::FramePlane& v_plane) {
44 DrawQuad::SetAll(shared_quad_state, DrawQuad::YUV_VIDEO_CONTENT, rect, 44 DrawQuad::SetAll(shared_quad_state, DrawQuad::YUV_VIDEO_CONTENT, rect,
45 opaque_rect, visible_rect, needs_blending); 45 opaque_rect, visible_rect, needs_blending, AntiAliasing());
46 this->tex_scale = tex_scale; 46 this->tex_scale = tex_scale;
47 this->y_plane = y_plane; 47 this->y_plane = y_plane;
48 this->u_plane = u_plane; 48 this->u_plane = u_plane;
49 this->v_plane = v_plane; 49 this->v_plane = v_plane;
50 } 50 }
51 51
52 const YUVVideoDrawQuad* YUVVideoDrawQuad::MaterialCast( 52 const YUVVideoDrawQuad* YUVVideoDrawQuad::MaterialCast(
53 const DrawQuad* quad) { 53 const DrawQuad* quad) {
54 DCHECK(quad->material == DrawQuad::YUV_VIDEO_CONTENT); 54 DCHECK(quad->material == DrawQuad::YUV_VIDEO_CONTENT);
55 return static_cast<const YUVVideoDrawQuad*>(quad); 55 return static_cast<const YUVVideoDrawQuad*>(quad);
56 } 56 }
57 57
58 } // namespace cc 58 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698