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

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

Issue 1835843002: WIP: Fix foreignObject cullrect Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « cc/playback/display_item_list_unittest.cc ('k') | cc/playback/display_list_recording_source.cc » ('j') | 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/display_list_raster_source.h" 5 #include "cc/playback/display_list_raster_source.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 const gfx::Rect& canvas_playback_rect, 244 const gfx::Rect& canvas_playback_rect,
245 float contents_scale) const { 245 float contents_scale) const {
246 canvas->translate(-canvas_bitmap_rect.x(), -canvas_bitmap_rect.y()); 246 canvas->translate(-canvas_bitmap_rect.x(), -canvas_bitmap_rect.y());
247 gfx::Rect content_rect = 247 gfx::Rect content_rect =
248 gfx::ScaleToEnclosingRect(gfx::Rect(size_), contents_scale); 248 gfx::ScaleToEnclosingRect(gfx::Rect(size_), contents_scale);
249 content_rect.Intersect(canvas_playback_rect); 249 content_rect.Intersect(canvas_playback_rect);
250 250
251 canvas->clipRect(gfx::RectToSkRect(content_rect), SkRegion::kIntersect_Op); 251 canvas->clipRect(gfx::RectToSkRect(content_rect), SkRegion::kIntersect_Op);
252 252
253 DCHECK(display_list_.get()); 253 DCHECK(display_list_.get());
254 gfx::Rect canvas_target_playback_rect =
255 canvas_playback_rect - canvas_bitmap_rect.OffsetFromOrigin();
256 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_); 254 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_);
257 for (int i = 0; i < repeat_count; ++i) { 255 for (int i = 0; i < repeat_count; ++i) {
258 display_list_->Raster(canvas, callback, canvas_target_playback_rect, 256 display_list_->Raster(canvas, callback, canvas_playback_rect,
259 contents_scale); 257 contents_scale);
260 } 258 }
261 } 259 }
262 260
263 sk_sp<SkPicture> DisplayListRasterSource::GetFlattenedPicture() { 261 sk_sp<SkPicture> DisplayListRasterSource::GetFlattenedPicture() {
264 TRACE_EVENT0("cc", "DisplayListRasterSource::GetFlattenedPicture"); 262 TRACE_EVENT0("cc", "DisplayListRasterSource::GetFlattenedPicture");
265 263
266 gfx::Rect display_list_rect(size_); 264 gfx::Rect display_list_rect(size_);
267 SkPictureRecorder recorder; 265 SkPictureRecorder recorder;
268 SkCanvas* canvas = recorder.beginRecording(display_list_rect.width(), 266 SkCanvas* canvas = recorder.beginRecording(display_list_rect.width(),
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 base::trace_event::MemoryAllocatorDump* dump = 381 base::trace_event::MemoryAllocatorDump* dump =
384 pmd->CreateAllocatorDump(dump_name); 382 pmd->CreateAllocatorDump(dump_name);
385 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, 383 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
386 base::trace_event::MemoryAllocatorDump::kUnitsBytes, 384 base::trace_event::MemoryAllocatorDump::kUnitsBytes,
387 memory_usage); 385 memory_usage);
388 } 386 }
389 return true; 387 return true;
390 } 388 }
391 389
392 } // namespace cc 390 } // namespace cc
OLDNEW
« no previous file with comments | « cc/playback/display_item_list_unittest.cc ('k') | cc/playback/display_list_recording_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698