OLD | NEW |
(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/quads/picture_draw_quad.h" |
| 6 |
| 7 namespace cc { |
| 8 |
| 9 PictureDrawQuad::PictureDrawQuad() { |
| 10 } |
| 11 |
| 12 PictureDrawQuad::~PictureDrawQuad() { |
| 13 } |
| 14 |
| 15 scoped_ptr<PictureDrawQuad> PictureDrawQuad::Create() { |
| 16 return make_scoped_ptr(new PictureDrawQuad); |
| 17 } |
| 18 |
| 19 void PictureDrawQuad::SetNew(const SharedQuadState* shared_quad_state, |
| 20 gfx::Rect rect, |
| 21 gfx::Rect opaque_rect, |
| 22 const gfx::RectF& tex_coord_rect, |
| 23 gfx::Size texture_size, |
| 24 bool swizzle_contents, |
| 25 gfx::Rect content_rect, |
| 26 float contents_scale, |
| 27 scoped_refptr<PicturePileImpl> picture_pile) { |
| 28 ContentDrawQuadBase::SetNew(shared_quad_state, DrawQuad::PICTURE_CONTENT, |
| 29 rect, opaque_rect, tex_coord_rect, texture_size, |
| 30 swizzle_contents); |
| 31 this->content_rect = content_rect; |
| 32 this->contents_scale = contents_scale; |
| 33 this->picture_pile = picture_pile; |
| 34 } |
| 35 |
| 36 void PictureDrawQuad::SetAll(const SharedQuadState* shared_quad_state, |
| 37 gfx::Rect rect, |
| 38 gfx::Rect opaque_rect, |
| 39 gfx::Rect visible_rect, |
| 40 bool needs_blending, |
| 41 const gfx::RectF& tex_coord_rect, |
| 42 gfx::Size texture_size, |
| 43 bool swizzle_contents, |
| 44 gfx::Rect content_rect, |
| 45 float contents_scale, |
| 46 scoped_refptr<PicturePileImpl> picture_pile) { |
| 47 ContentDrawQuadBase::SetAll(shared_quad_state, |
| 48 DrawQuad::PICTURE_CONTENT, rect, opaque_rect, |
| 49 visible_rect, needs_blending, tex_coord_rect, |
| 50 texture_size, swizzle_contents); |
| 51 this->content_rect = content_rect; |
| 52 this->contents_scale = contents_scale; |
| 53 this->picture_pile = picture_pile; |
| 54 } |
| 55 |
| 56 void PictureDrawQuad::IterateResources( |
| 57 const ResourceIteratorCallback& callback) { |
| 58 // TODO(danakj): Convert to TextureDrawQuad? |
| 59 NOTIMPLEMENTED(); |
| 60 } |
| 61 |
| 62 const PictureDrawQuad* PictureDrawQuad::MaterialCast(const DrawQuad* quad) { |
| 63 DCHECK(quad->material == DrawQuad::PICTURE_CONTENT); |
| 64 return static_cast<const PictureDrawQuad*>(quad); |
| 65 } |
| 66 |
| 67 } // namespace cc |
OLD | NEW |