OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/render_pass.h" | 5 #include "cc/render_pass.h" |
6 | 6 |
7 #include "third_party/skia/include/core/SkImageFilter.h" | |
8 | |
9 namespace cc { | 7 namespace cc { |
10 | 8 |
11 scoped_ptr<RenderPass> RenderPass::Create() { | 9 scoped_ptr<RenderPass> RenderPass::Create() { |
12 return make_scoped_ptr(new RenderPass); | 10 return make_scoped_ptr(new RenderPass); |
13 } | 11 } |
14 | 12 |
15 RenderPass::RenderPass() | 13 RenderPass::RenderPass() |
16 : id(Id(-1, -1)), | 14 : id(Id(-1, -1)), |
17 has_transparent_background(true), | 15 has_transparent_background(true), |
18 has_occlusion_from_outside_target_surface(false), | 16 has_occlusion_from_outside_target_surface(false) { |
19 filter(NULL) { | |
20 } | 17 } |
21 | 18 |
22 RenderPass::~RenderPass() { | 19 RenderPass::~RenderPass() { |
23 SkSafeUnref(filter); | |
24 } | 20 } |
25 | 21 |
26 scoped_ptr<RenderPass> RenderPass::Copy(Id new_id) const { | 22 scoped_ptr<RenderPass> RenderPass::Copy(Id new_id) const { |
27 DCHECK(new_id != id); | 23 DCHECK(new_id != id); |
28 | 24 |
29 scoped_ptr<RenderPass> copy_pass(Create()); | 25 scoped_ptr<RenderPass> copy_pass(Create()); |
30 copy_pass->SetAll(new_id, | 26 copy_pass->SetAll(new_id, |
31 output_rect, | 27 output_rect, |
32 damage_rect, | 28 damage_rect, |
33 transform_to_root_target, | 29 transform_to_root_target, |
(...skipping 21 matching lines...) Expand all Loading... |
55 DCHECK(shared_quad_state_list.isEmpty()); | 51 DCHECK(shared_quad_state_list.isEmpty()); |
56 } | 52 } |
57 | 53 |
58 void RenderPass::SetAll(Id id, | 54 void RenderPass::SetAll(Id id, |
59 gfx::Rect output_rect, | 55 gfx::Rect output_rect, |
60 gfx::RectF damage_rect, | 56 gfx::RectF damage_rect, |
61 const gfx::Transform& transform_to_root_target, | 57 const gfx::Transform& transform_to_root_target, |
62 bool has_transparent_background, | 58 bool has_transparent_background, |
63 bool has_occlusion_from_outside_target_surface, | 59 bool has_occlusion_from_outside_target_surface, |
64 const WebKit::WebFilterOperations& filters, | 60 const WebKit::WebFilterOperations& filters, |
65 SkImageFilter* filter, | 61 const SkiaRefPtr<SkImageFilter>& filter, |
66 const WebKit::WebFilterOperations& background_filters) { | 62 const WebKit::WebFilterOperations& background_filters) { |
67 DCHECK_GT(id.layer_id, 0); | 63 DCHECK_GT(id.layer_id, 0); |
68 DCHECK_GE(id.index, 0); | 64 DCHECK_GE(id.index, 0); |
69 | 65 |
70 this->id = id; | 66 this->id = id; |
71 this->output_rect = output_rect; | 67 this->output_rect = output_rect; |
72 this->damage_rect = damage_rect; | 68 this->damage_rect = damage_rect; |
73 this->transform_to_root_target = transform_to_root_target; | 69 this->transform_to_root_target = transform_to_root_target; |
74 this->has_transparent_background = has_transparent_background; | 70 this->has_transparent_background = has_transparent_background; |
75 this->has_occlusion_from_outside_target_surface = | 71 this->has_occlusion_from_outside_target_surface = |
76 has_occlusion_from_outside_target_surface; | 72 has_occlusion_from_outside_target_surface; |
77 this->filters = filters; | 73 this->filters = filters; |
78 SkRefCnt_SafeAssign(this->filter, filter); | 74 this->filter = filter; |
79 this->background_filters = background_filters; | 75 this->background_filters = background_filters; |
80 | 76 |
81 DCHECK(quad_list.isEmpty()); | 77 DCHECK(quad_list.isEmpty()); |
82 DCHECK(shared_quad_state_list.isEmpty()); | 78 DCHECK(shared_quad_state_list.isEmpty()); |
83 } | 79 } |
84 | 80 |
85 } // namespace cc | 81 } // namespace cc |
OLD | NEW |