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/layers/render_surface_impl.h" | 5 #include "cc/layers/render_surface_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 return base::StringPrintf("RenderSurfaceImpl(id=%i,owner=%s)", | 57 return base::StringPrintf("RenderSurfaceImpl(id=%i,owner=%s)", |
58 owning_layer_->id(), | 58 owning_layer_->id(), |
59 owning_layer_->debug_name().data()); | 59 owning_layer_->debug_name().data()); |
60 } | 60 } |
61 | 61 |
62 int RenderSurfaceImpl::OwningLayerId() const { | 62 int RenderSurfaceImpl::OwningLayerId() const { |
63 return owning_layer_ ? owning_layer_->id() : 0; | 63 return owning_layer_ ? owning_layer_->id() : 0; |
64 } | 64 } |
65 | 65 |
66 | 66 |
67 void RenderSurfaceImpl::SetClipRect(gfx::Rect clip_rect) { | 67 void RenderSurfaceImpl::SetClipRect(const gfx::Rect& clip_rect) { |
68 if (clip_rect_ == clip_rect) | 68 if (clip_rect_ == clip_rect) |
69 return; | 69 return; |
70 | 70 |
71 surface_property_changed_ = true; | 71 surface_property_changed_ = true; |
72 clip_rect_ = clip_rect; | 72 clip_rect_ = clip_rect; |
73 } | 73 } |
74 | 74 |
75 bool RenderSurfaceImpl::ContentsChanged() const { | 75 bool RenderSurfaceImpl::ContentsChanged() const { |
76 return !damage_tracker_->current_damage_rect().IsEmpty(); | 76 return !damage_tracker_->current_damage_rect().IsEmpty(); |
77 } | 77 } |
78 | 78 |
79 void RenderSurfaceImpl::SetContentRect(gfx::Rect content_rect) { | 79 void RenderSurfaceImpl::SetContentRect(const gfx::Rect& content_rect) { |
80 if (content_rect_ == content_rect) | 80 if (content_rect_ == content_rect) |
81 return; | 81 return; |
82 | 82 |
83 surface_property_changed_ = true; | 83 surface_property_changed_ = true; |
84 content_rect_ = content_rect; | 84 content_rect_ = content_rect; |
85 } | 85 } |
86 | 86 |
87 bool RenderSurfaceImpl::SurfacePropertyChanged() const { | 87 bool RenderSurfaceImpl::SurfacePropertyChanged() const { |
88 // Surface property changes are tracked as follows: | 88 // Surface property changes are tracked as follows: |
89 // | 89 // |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 for_replica, | 227 for_replica, |
228 mask_resource_id, | 228 mask_resource_id, |
229 contents_changed_since_last_frame, | 229 contents_changed_since_last_frame, |
230 mask_uv_rect, | 230 mask_uv_rect, |
231 owning_layer_->filters(), | 231 owning_layer_->filters(), |
232 owning_layer_->background_filters()); | 232 owning_layer_->background_filters()); |
233 quad_sink->Append(quad.PassAs<DrawQuad>(), append_quads_data); | 233 quad_sink->Append(quad.PassAs<DrawQuad>(), append_quads_data); |
234 } | 234 } |
235 | 235 |
236 } // namespace cc | 236 } // namespace cc |
OLD | NEW |