Separate projection mode from rest of touch HUD
[chromium-blink-merge.git] / cc / quads / picture_draw_quad.cc
blob81f79138bb7acf410960fbeef7a8ba4677eacb75
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.
5 #include "cc/quads/picture_draw_quad.h"
7 namespace cc {
9 PictureDrawQuad::PictureDrawQuad() {
12 PictureDrawQuad::~PictureDrawQuad() {
15 scoped_ptr<PictureDrawQuad> PictureDrawQuad::Create() {
16 return make_scoped_ptr(new PictureDrawQuad);
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 bool can_draw_direct_to_backbuffer,
28 scoped_refptr<PicturePileImpl> picture_pile) {
29 ContentDrawQuadBase::SetNew(shared_quad_state, DrawQuad::PICTURE_CONTENT,
30 rect, opaque_rect, tex_coord_rect, texture_size,
31 swizzle_contents);
32 this->content_rect = content_rect;
33 this->contents_scale = contents_scale;
34 this->can_draw_direct_to_backbuffer = can_draw_direct_to_backbuffer;
35 this->picture_pile = picture_pile;
38 void PictureDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
39 gfx::Rect rect,
40 gfx::Rect opaque_rect,
41 gfx::Rect visible_rect,
42 bool needs_blending,
43 const gfx::RectF& tex_coord_rect,
44 gfx::Size texture_size,
45 bool swizzle_contents,
46 gfx::Rect content_rect,
47 float contents_scale,
48 bool can_draw_direct_to_backbuffer,
49 scoped_refptr<PicturePileImpl> picture_pile) {
50 ContentDrawQuadBase::SetAll(shared_quad_state,
51 DrawQuad::PICTURE_CONTENT, rect, opaque_rect,
52 visible_rect, needs_blending, tex_coord_rect,
53 texture_size, swizzle_contents);
54 this->content_rect = content_rect;
55 this->contents_scale = contents_scale;
56 this->can_draw_direct_to_backbuffer = can_draw_direct_to_backbuffer;
57 this->picture_pile = picture_pile;
60 void PictureDrawQuad::IterateResources(
61 const ResourceIteratorCallback& callback) {
62 // TODO(danakj): Convert to TextureDrawQuad?
63 NOTIMPLEMENTED();
66 const PictureDrawQuad* PictureDrawQuad::MaterialCast(const DrawQuad* quad) {
67 DCHECK(quad->material == DrawQuad::PICTURE_CONTENT);
68 return static_cast<const PictureDrawQuad*>(quad);
71 } // namespace cc