| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/playback/raster_source.h" | 5 #include "cc/playback/raster_source.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 void RasterSource::GetDiscardableImagesInRect( | 241 void RasterSource::GetDiscardableImagesInRect( |
| 242 const gfx::Rect& layer_rect, | 242 const gfx::Rect& layer_rect, |
| 243 float contents_scale, | 243 float contents_scale, |
| 244 std::vector<DrawImage>* images) const { | 244 std::vector<DrawImage>* images) const { |
| 245 DCHECK_EQ(0u, images->size()); | 245 DCHECK_EQ(0u, images->size()); |
| 246 display_list_->GetDiscardableImagesInRect(layer_rect, contents_scale, images); | 246 display_list_->GetDiscardableImagesInRect(layer_rect, contents_scale, images); |
| 247 } | 247 } |
| 248 | 248 |
| 249 gfx::Rect RasterSource::GetRectForImage(ImageId image_id) const { | 249 gfx::Rect RasterSource::GetRectForImage(ImageId image_id) const { |
| 250 if (!display_list_) |
| 251 return gfx::Rect(); |
| 250 return display_list_->GetRectForImage(image_id); | 252 return display_list_->GetRectForImage(image_id); |
| 251 } | 253 } |
| 252 | 254 |
| 253 bool RasterSource::CoversRect(const gfx::Rect& layer_rect) const { | 255 bool RasterSource::CoversRect(const gfx::Rect& layer_rect) const { |
| 254 if (size_.IsEmpty()) | 256 if (size_.IsEmpty()) |
| 255 return false; | 257 return false; |
| 256 gfx::Rect bounded_rect = layer_rect; | 258 gfx::Rect bounded_rect = layer_rect; |
| 257 bounded_rect.Intersect(gfx::Rect(size_)); | 259 bounded_rect.Intersect(gfx::Rect(size_)); |
| 258 return recorded_viewport_.Contains(bounded_rect); | 260 return recorded_viewport_.Contains(bounded_rect); |
| 259 } | 261 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 use_image_hijack_canvas(true) {} | 306 use_image_hijack_canvas(true) {} |
| 305 | 307 |
| 306 RasterSource::PlaybackSettings::PlaybackSettings(const PlaybackSettings&) = | 308 RasterSource::PlaybackSettings::PlaybackSettings(const PlaybackSettings&) = |
| 307 default; | 309 default; |
| 308 | 310 |
| 309 RasterSource::PlaybackSettings::PlaybackSettings(PlaybackSettings&&) = default; | 311 RasterSource::PlaybackSettings::PlaybackSettings(PlaybackSettings&&) = default; |
| 310 | 312 |
| 311 RasterSource::PlaybackSettings::~PlaybackSettings() = default; | 313 RasterSource::PlaybackSettings::~PlaybackSettings() = default; |
| 312 | 314 |
| 313 } // namespace cc | 315 } // namespace cc |
| OLD | NEW |