| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/quads/picture_draw_quad.h" | 5 #include "cc/quads/picture_draw_quad.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
| 9 #include "cc/resources/platform_color.h" | 9 #include "cc/resources/platform_color.h" |
| 10 | 10 |
| 11 namespace cc { | 11 namespace cc { |
| 12 | 12 |
| 13 PictureDrawQuad::PictureDrawQuad() { | 13 PictureDrawQuad::PictureDrawQuad() { |
| 14 } | 14 } |
| 15 | 15 |
| 16 PictureDrawQuad::~PictureDrawQuad() { | 16 PictureDrawQuad::~PictureDrawQuad() { |
| 17 } | 17 } |
| 18 | 18 |
| 19 scoped_ptr<PictureDrawQuad> PictureDrawQuad::Create() { | 19 scoped_ptr<PictureDrawQuad> PictureDrawQuad::Create() { |
| 20 return make_scoped_ptr(new PictureDrawQuad); | 20 return make_scoped_ptr(new PictureDrawQuad); |
| 21 } | 21 } |
| 22 | 22 |
| 23 void PictureDrawQuad::SetNew(const SharedQuadState* shared_quad_state, | 23 void PictureDrawQuad::SetNew(const SharedQuadState* shared_quad_state, |
| 24 const gfx::Rect& rect, | 24 const gfx::Rect& rect, |
| 25 const gfx::Rect& opaque_rect, | 25 const gfx::Rect& opaque_rect, |
| 26 const gfx::RectF& tex_coord_rect, | 26 const gfx::RectF& tex_coord_rect, |
| 27 const gfx::Size& texture_size, | 27 gfx::Size texture_size, |
| 28 ResourceFormat texture_format, | 28 ResourceFormat texture_format, |
| 29 const gfx::Rect& content_rect, | 29 const gfx::Rect& content_rect, |
| 30 float contents_scale, | 30 float contents_scale, |
| 31 scoped_refptr<PicturePileImpl> picture_pile) { | 31 scoped_refptr<PicturePileImpl> picture_pile) { |
| 32 ContentDrawQuadBase::SetNew(shared_quad_state, | 32 ContentDrawQuadBase::SetNew(shared_quad_state, |
| 33 DrawQuad::PICTURE_CONTENT, | 33 DrawQuad::PICTURE_CONTENT, |
| 34 rect, | 34 rect, |
| 35 opaque_rect, | 35 opaque_rect, |
| 36 tex_coord_rect, | 36 tex_coord_rect, |
| 37 texture_size, | 37 texture_size, |
| 38 !PlatformColor::SameComponentOrder( | 38 !PlatformColor::SameComponentOrder( |
| 39 texture_format)); | 39 texture_format)); |
| 40 this->content_rect = content_rect; | 40 this->content_rect = content_rect; |
| 41 this->contents_scale = contents_scale; | 41 this->contents_scale = contents_scale; |
| 42 this->picture_pile = picture_pile; | 42 this->picture_pile = picture_pile; |
| 43 this->texture_format = texture_format; | 43 this->texture_format = texture_format; |
| 44 } | 44 } |
| 45 | 45 |
| 46 void PictureDrawQuad::SetAll(const SharedQuadState* shared_quad_state, | 46 void PictureDrawQuad::SetAll(const SharedQuadState* shared_quad_state, |
| 47 const gfx::Rect& rect, | 47 const gfx::Rect& rect, |
| 48 const gfx::Rect& opaque_rect, | 48 const gfx::Rect& opaque_rect, |
| 49 const gfx::Rect& visible_rect, | 49 const gfx::Rect& visible_rect, |
| 50 bool needs_blending, | 50 bool needs_blending, |
| 51 const gfx::RectF& tex_coord_rect, | 51 const gfx::RectF& tex_coord_rect, |
| 52 const gfx::Size& texture_size, | 52 gfx::Size texture_size, |
| 53 ResourceFormat texture_format, | 53 ResourceFormat texture_format, |
| 54 const gfx::Rect& content_rect, | 54 const gfx::Rect& content_rect, |
| 55 float contents_scale, | 55 float contents_scale, |
| 56 scoped_refptr<PicturePileImpl> picture_pile) { | 56 scoped_refptr<PicturePileImpl> picture_pile) { |
| 57 ContentDrawQuadBase::SetAll(shared_quad_state, | 57 ContentDrawQuadBase::SetAll(shared_quad_state, |
| 58 DrawQuad::PICTURE_CONTENT, | 58 DrawQuad::PICTURE_CONTENT, |
| 59 rect, | 59 rect, |
| 60 opaque_rect, | 60 opaque_rect, |
| 61 visible_rect, | 61 visible_rect, |
| 62 needs_blending, | 62 needs_blending, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 83 | 83 |
| 84 void PictureDrawQuad::ExtendValue(base::DictionaryValue* value) const { | 84 void PictureDrawQuad::ExtendValue(base::DictionaryValue* value) const { |
| 85 ContentDrawQuadBase::ExtendValue(value); | 85 ContentDrawQuadBase::ExtendValue(value); |
| 86 value->Set("content_rect", MathUtil::AsValue(content_rect).release()); | 86 value->Set("content_rect", MathUtil::AsValue(content_rect).release()); |
| 87 value->SetDouble("contents_scale", contents_scale); | 87 value->SetDouble("contents_scale", contents_scale); |
| 88 value->SetInteger("texture_format", texture_format); | 88 value->SetInteger("texture_format", texture_format); |
| 89 // TODO(piman): picture_pile? | 89 // TODO(piman): picture_pile? |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace cc | 92 } // namespace cc |
| OLD | NEW |