Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: cc/playback/raster_source.cc

Issue 2656983006: cc: Add image to rect map in DiscardableImageMap. (Closed)
Patch Set: rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« cc/playback/image_id.h ('K') | « cc/playback/raster_source.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
240 } 240 }
241 241
242 void RasterSource::GetDiscardableImagesInRect( 242 void RasterSource::GetDiscardableImagesInRect(
243 const gfx::Rect& layer_rect, 243 const gfx::Rect& layer_rect,
244 float contents_scale, 244 float contents_scale,
245 std::vector<DrawImage>* images) const { 245 std::vector<DrawImage>* images) const {
246 DCHECK_EQ(0u, images->size()); 246 DCHECK_EQ(0u, images->size());
247 display_list_->GetDiscardableImagesInRect(layer_rect, contents_scale, images); 247 display_list_->GetDiscardableImagesInRect(layer_rect, contents_scale, images);
248 } 248 }
249 249
250 gfx::Rect RasterSource::GetRectForImage(ImageId image_id) const {
251 return display_list_->GetRectForImage(image_id);
252 }
253
250 bool RasterSource::CoversRect(const gfx::Rect& layer_rect) const { 254 bool RasterSource::CoversRect(const gfx::Rect& layer_rect) const {
251 if (size_.IsEmpty()) 255 if (size_.IsEmpty())
252 return false; 256 return false;
253 gfx::Rect bounded_rect = layer_rect; 257 gfx::Rect bounded_rect = layer_rect;
254 bounded_rect.Intersect(gfx::Rect(size_)); 258 bounded_rect.Intersect(gfx::Rect(size_));
255 return recorded_viewport_.Contains(bounded_rect); 259 return recorded_viewport_.Contains(bounded_rect);
256 } 260 }
257 261
258 gfx::Size RasterSource::GetSize() const { 262 gfx::Size RasterSource::GetSize() const {
259 return size_; 263 return size_;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 bool can_use_lcd_text = false; 306 bool can_use_lcd_text = false;
303 return scoped_refptr<RasterSource>(new RasterSource(this, can_use_lcd_text)); 307 return scoped_refptr<RasterSource>(new RasterSource(this, can_use_lcd_text));
304 } 308 }
305 309
306 RasterSource::PlaybackSettings::PlaybackSettings() 310 RasterSource::PlaybackSettings::PlaybackSettings()
307 : playback_to_shared_canvas(false), 311 : playback_to_shared_canvas(false),
308 skip_images(false), 312 skip_images(false),
309 use_image_hijack_canvas(true) {} 313 use_image_hijack_canvas(true) {}
310 314
311 } // namespace cc 315 } // namespace cc
OLDNEW
« cc/playback/image_id.h ('K') | « cc/playback/raster_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698