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

Side by Side Diff: src/utils/SkDeferredCanvas.cpp

Issue 939103002: Do not playback existing commands for full deferred canvas writePixels (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 9 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 | « no previous file | tests/DeferredCanvasTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkDeferredCanvas.h" 9 #include "SkDeferredCanvas.h"
10 10
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 438
439 fImmediateCanvas->flush(); 439 fImmediateCanvas->flush();
440 } 440 }
441 441
442 bool SkDeferredDevice::onWritePixels(const SkImageInfo& info, const void* pixels , size_t rowBytes, 442 bool SkDeferredDevice::onWritePixels(const SkImageInfo& info, const void* pixels , size_t rowBytes,
443 int x, int y) { 443 int x, int y) {
444 SkASSERT(x >= 0 && y >= 0); 444 SkASSERT(x >= 0 && y >= 0);
445 SkASSERT(x + info.width() <= width()); 445 SkASSERT(x + info.width() <= width());
446 SkASSERT(y + info.height() <= height()); 446 SkASSERT(y + info.height() <= height());
447 447
448 this->flushPendingCommands(kNormal_PlaybackMode);
449
450 const SkImageInfo deviceInfo = this->imageInfo(); 448 const SkImageInfo deviceInfo = this->imageInfo();
451 if (info.width() == deviceInfo.width() && info.height() == deviceInfo.height ()) { 449 if (info.width() == deviceInfo.width() && info.height() == deviceInfo.height ()) {
452 this->skipPendingCommands(); 450 this->skipPendingCommands();
451 } else {
452 this->flushPendingCommands(kNormal_PlaybackMode);
453 } 453 }
454 454
455 this->prepareForImmediatePixelWrite(); 455 this->prepareForImmediatePixelWrite();
456 return immediateDevice()->onWritePixels(info, pixels, rowBytes, x, y); 456 return immediateDevice()->onWritePixels(info, pixels, rowBytes, x, y);
457 } 457 }
458 458
459 const SkBitmap& SkDeferredDevice::onAccessBitmap() { 459 const SkBitmap& SkDeferredDevice::onAccessBitmap() {
460 this->flushPendingCommands(kNormal_PlaybackMode); 460 this->flushPendingCommands(kNormal_PlaybackMode);
461 return immediateDevice()->accessBitmap(false); 461 return immediateDevice()->accessBitmap(false);
462 } 462 }
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { 934 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) {
935 this->drawingCanvas()->setDrawFilter(filter); 935 this->drawingCanvas()->setDrawFilter(filter);
936 this->INHERITED::setDrawFilter(filter); 936 this->INHERITED::setDrawFilter(filter);
937 this->recordedDrawCommand(); 937 this->recordedDrawCommand();
938 return filter; 938 return filter;
939 } 939 }
940 940
941 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { 941 SkCanvas* SkDeferredCanvas::canvasForDrawIter() {
942 return this->drawingCanvas(); 942 return this->drawingCanvas();
943 } 943 }
OLDNEW
« no previous file with comments | « no previous file | tests/DeferredCanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698