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