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

Side by Side Diff: cc/picture_draw_quad.cc

Issue 12642010: Implement on demand quad rasterization for PicturePiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
(Empty)
1 // Copyright 2013 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.
4
5 #include "cc/picture_draw_quad.h"
6
7 namespace cc {
8
9 PictureDrawQuad::PictureDrawQuad() {
10 }
11
12 scoped_ptr<PictureDrawQuad> PictureDrawQuad::Create() {
13 return make_scoped_ptr(new PictureDrawQuad);
14 }
15
16 void PictureDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
17 const gfx::Rect& rect,
18 const gfx::Rect& opaque_rect,
19 const gfx::RectF& tex_coord_rect,
20 const gfx::Size& texture_size,
21 bool swizzle_contents,
22 const gfx::Rect& content_rect,
23 float contents_scale,
24 scoped_refptr<PicturePileImpl> picture_pile) {
25 TileDrawQuad::SetNew(shared_quad_state, rect, opaque_rect, 0, tex_coord_rect,
26 texture_size, swizzle_contents);
27
28 this->content_rect = content_rect;
29 this->contents_scale = contents_scale;
30 this->picture_pile = picture_pile;
31 }
32
33 void PictureDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
34 const gfx::Rect& rect,
35 const gfx::Rect& opaque_rect,
36 const gfx::Rect& visible_rect,
37 bool needs_blending,
38 const gfx::RectF& tex_coord_rect,
39 const gfx::Size& texture_size,
40 bool swizzle_contents,
41 const gfx::Rect& content_rect,
42 float contents_scale,
43 scoped_refptr<PicturePileImpl> picture_pile) {
44 TileDrawQuad::SetAll(shared_quad_state, rect, opaque_rect, visible_rect,
45 needs_blending, 0, tex_coord_rect, texture_size, swizzle_contents);
46 this->content_rect = content_rect;
47 this->contents_scale = contents_scale;
48 this->picture_pile = picture_pile;
49 }
50
51 bool PictureDrawQuad::IsPictureQuad() const {
52 return true;
53 }
54
55 DrawQuad::Material PictureDrawQuad::material() const {
56 return DrawQuad::PICTURE_CONTENT;
57 }
58
59 void PictureDrawQuad::IterateResources(
60 const ResourceIteratorCallback& callback) {
61 }
62
63 const PictureDrawQuad* PictureDrawQuad::MaterialCast(const DrawQuad* quad) {
64 DCHECK(quad->material == DrawQuad::PICTURE_CONTENT);
65 return static_cast<const PictureDrawQuad*>(quad);
66 }
67
68 } // namespacec cc
palmer 2013/03/14 00:09:21 Typo :)
Leandro GraciĆ” Gil 2013/03/19 17:30:07 Done.
69
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698