| 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/trace_event/trace_event_argument.h" | 7 #include "base/trace_event/trace_event_argument.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
| 10 #include "cc/resources/platform_color.h" | 10 #include "cc/resources/platform_color.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 PictureDrawQuad::PictureDrawQuad() { | 14 PictureDrawQuad::PictureDrawQuad() { |
| 15 } | 15 } |
| 16 | 16 |
| 17 PictureDrawQuad::PictureDrawQuad(const PictureDrawQuad& other) = default; | 17 PictureDrawQuad::PictureDrawQuad(const PictureDrawQuad& other) = default; |
| 18 | 18 |
| 19 PictureDrawQuad::~PictureDrawQuad() { | 19 PictureDrawQuad::~PictureDrawQuad() { |
| 20 } | 20 } |
| 21 | 21 |
| 22 void PictureDrawQuad::SetNew( | 22 void PictureDrawQuad::SetNew(const SharedQuadState* shared_quad_state, |
| 23 const SharedQuadState* shared_quad_state, | 23 const gfx::Rect& rect, |
| 24 const gfx::Rect& rect, | 24 const gfx::Rect& opaque_rect, |
| 25 const gfx::Rect& opaque_rect, | 25 const gfx::Rect& visible_rect, |
| 26 const gfx::Rect& visible_rect, | 26 const gfx::RectF& tex_coord_rect, |
| 27 const gfx::RectF& tex_coord_rect, | 27 const gfx::Size& texture_size, |
| 28 const gfx::Size& texture_size, | 28 bool nearest_neighbor, |
| 29 bool nearest_neighbor, | 29 ResourceFormat texture_format, |
| 30 ResourceFormat texture_format, | 30 const gfx::Rect& content_rect, |
| 31 const gfx::Rect& content_rect, | 31 float contents_scale, |
| 32 float contents_scale, | 32 scoped_refptr<RasterSource> raster_source) { |
| 33 scoped_refptr<DisplayListRasterSource> raster_source) { | |
| 34 ContentDrawQuadBase::SetNew( | 33 ContentDrawQuadBase::SetNew( |
| 35 shared_quad_state, | 34 shared_quad_state, |
| 36 DrawQuad::PICTURE_CONTENT, | 35 DrawQuad::PICTURE_CONTENT, |
| 37 rect, | 36 rect, |
| 38 opaque_rect, | 37 opaque_rect, |
| 39 visible_rect, | 38 visible_rect, |
| 40 tex_coord_rect, | 39 tex_coord_rect, |
| 41 texture_size, | 40 texture_size, |
| 42 !PlatformColor::SameComponentOrder(texture_format), | 41 !PlatformColor::SameComponentOrder(texture_format), |
| 43 nearest_neighbor); | 42 nearest_neighbor); |
| 44 this->content_rect = content_rect; | 43 this->content_rect = content_rect; |
| 45 this->contents_scale = contents_scale; | 44 this->contents_scale = contents_scale; |
| 46 this->raster_source = raster_source; | 45 this->raster_source = raster_source; |
| 47 this->texture_format = texture_format; | 46 this->texture_format = texture_format; |
| 48 } | 47 } |
| 49 | 48 |
| 50 void PictureDrawQuad::SetAll( | 49 void PictureDrawQuad::SetAll(const SharedQuadState* shared_quad_state, |
| 51 const SharedQuadState* shared_quad_state, | 50 const gfx::Rect& rect, |
| 52 const gfx::Rect& rect, | 51 const gfx::Rect& opaque_rect, |
| 53 const gfx::Rect& opaque_rect, | 52 const gfx::Rect& visible_rect, |
| 54 const gfx::Rect& visible_rect, | 53 bool needs_blending, |
| 55 bool needs_blending, | 54 const gfx::RectF& tex_coord_rect, |
| 56 const gfx::RectF& tex_coord_rect, | 55 const gfx::Size& texture_size, |
| 57 const gfx::Size& texture_size, | 56 bool nearest_neighbor, |
| 58 bool nearest_neighbor, | 57 ResourceFormat texture_format, |
| 59 ResourceFormat texture_format, | 58 const gfx::Rect& content_rect, |
| 60 const gfx::Rect& content_rect, | 59 float contents_scale, |
| 61 float contents_scale, | 60 scoped_refptr<RasterSource> raster_source) { |
| 62 scoped_refptr<DisplayListRasterSource> raster_source) { | |
| 63 ContentDrawQuadBase::SetAll(shared_quad_state, | 61 ContentDrawQuadBase::SetAll(shared_quad_state, |
| 64 DrawQuad::PICTURE_CONTENT, | 62 DrawQuad::PICTURE_CONTENT, |
| 65 rect, | 63 rect, |
| 66 opaque_rect, | 64 opaque_rect, |
| 67 visible_rect, | 65 visible_rect, |
| 68 needs_blending, | 66 needs_blending, |
| 69 tex_coord_rect, | 67 tex_coord_rect, |
| 70 texture_size, | 68 texture_size, |
| 71 !PlatformColor::SameComponentOrder( | 69 !PlatformColor::SameComponentOrder( |
| 72 texture_format), | 70 texture_format), |
| (...skipping 11 matching lines...) Expand all Loading... |
| 84 | 82 |
| 85 void PictureDrawQuad::ExtendValue(base::trace_event::TracedValue* value) const { | 83 void PictureDrawQuad::ExtendValue(base::trace_event::TracedValue* value) const { |
| 86 ContentDrawQuadBase::ExtendValue(value); | 84 ContentDrawQuadBase::ExtendValue(value); |
| 87 MathUtil::AddToTracedValue("content_rect", content_rect, value); | 85 MathUtil::AddToTracedValue("content_rect", content_rect, value); |
| 88 value->SetDouble("contents_scale", contents_scale); | 86 value->SetDouble("contents_scale", contents_scale); |
| 89 value->SetInteger("texture_format", texture_format); | 87 value->SetInteger("texture_format", texture_format); |
| 90 // TODO(piman): raster_source? | 88 // TODO(piman): raster_source? |
| 91 } | 89 } |
| 92 | 90 |
| 93 } // namespace cc | 91 } // namespace cc |
| OLD | NEW |