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

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

Issue 1484163002: Raster display item lists via a visual rect RTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head and flip for LayoutInline. Created 4 years, 6 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
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/region.h" 10 #include "cc/base/region.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 const gfx::Rect& canvas_playback_rect, 190 const gfx::Rect& canvas_playback_rect,
191 float contents_scale) const { 191 float contents_scale) const {
192 canvas->translate(-canvas_bitmap_rect.x(), -canvas_bitmap_rect.y()); 192 canvas->translate(-canvas_bitmap_rect.x(), -canvas_bitmap_rect.y());
193 gfx::Rect content_rect = 193 gfx::Rect content_rect =
194 gfx::ScaleToEnclosingRect(gfx::Rect(size_), contents_scale); 194 gfx::ScaleToEnclosingRect(gfx::Rect(size_), contents_scale);
195 content_rect.Intersect(canvas_playback_rect); 195 content_rect.Intersect(canvas_playback_rect);
196 196
197 canvas->clipRect(gfx::RectToSkRect(content_rect), SkRegion::kIntersect_Op); 197 canvas->clipRect(gfx::RectToSkRect(content_rect), SkRegion::kIntersect_Op);
198 198
199 DCHECK(display_list_.get()); 199 DCHECK(display_list_.get());
200 gfx::Rect canvas_target_playback_rect =
201 canvas_playback_rect - canvas_bitmap_rect.OffsetFromOrigin();
202 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_); 200 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_);
203 for (int i = 0; i < repeat_count; ++i) { 201 for (int i = 0; i < repeat_count; ++i) {
204 display_list_->Raster(canvas, callback, canvas_target_playback_rect, 202 display_list_->Raster(canvas, callback, canvas_playback_rect,
205 contents_scale); 203 contents_scale);
206 } 204 }
207 } 205 }
208 206
209 sk_sp<SkPicture> RasterSource::GetFlattenedPicture() { 207 sk_sp<SkPicture> RasterSource::GetFlattenedPicture() {
210 TRACE_EVENT0("cc", "RasterSource::GetFlattenedPicture"); 208 TRACE_EVENT0("cc", "RasterSource::GetFlattenedPicture");
211 209
212 gfx::Rect display_list_rect(size_); 210 gfx::Rect display_list_rect(size_);
213 SkPictureRecorder recorder; 211 SkPictureRecorder recorder;
214 SkCanvas* canvas = recorder.beginRecording(display_list_rect.width(), 212 SkCanvas* canvas = recorder.beginRecording(display_list_rect.width(),
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 DCHECK(image_decode_controller); 310 DCHECK(image_decode_controller);
313 image_decode_controller_ = image_decode_controller; 311 image_decode_controller_ = image_decode_controller;
314 } 312 }
315 313
316 RasterSource::PlaybackSettings::PlaybackSettings() 314 RasterSource::PlaybackSettings::PlaybackSettings()
317 : playback_to_shared_canvas(false), 315 : playback_to_shared_canvas(false),
318 skip_images(false), 316 skip_images(false),
319 use_image_hijack_canvas(true) {} 317 use_image_hijack_canvas(true) {}
320 318
321 } // namespace cc 319 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698