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

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

Issue 20806003: Plumb in "bleed" flag (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: trying again after timeout Created 7 years, 4 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 | Annotate | Revision Log
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 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 } 891 }
892 892
893 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); 893 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint);
894 this->drawingCanvas()->drawBitmap(bitmap, left, top, paint); 894 this->drawingCanvas()->drawBitmap(bitmap, left, top, paint);
895 this->recordedDrawCommand(); 895 this->recordedDrawCommand();
896 } 896 }
897 897
898 void SkDeferredCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, 898 void SkDeferredCanvas::drawBitmapRectToRect(const SkBitmap& bitmap,
899 const SkRect* src, 899 const SkRect* src,
900 const SkRect& dst, 900 const SkRect& dst,
901 const SkPaint* paint) { 901 const SkPaint* paint,
902 DrawBitmapRectFlags flags) {
902 if (fDeferredDrawing && 903 if (fDeferredDrawing &&
903 this->isFullFrame(&dst, paint) && 904 this->isFullFrame(&dst, paint) &&
904 isPaintOpaque(paint, &bitmap)) { 905 isPaintOpaque(paint, &bitmap)) {
905 this->getDeferredDevice()->skipPendingCommands(); 906 this->getDeferredDevice()->skipPendingCommands();
906 } 907 }
907 908
908 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); 909 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint);
909 this->drawingCanvas()->drawBitmapRectToRect(bitmap, src, dst, paint); 910 this->drawingCanvas()->drawBitmapRectToRect(bitmap, src, dst, paint, flags);
910 this->recordedDrawCommand(); 911 this->recordedDrawCommand();
911 } 912 }
912 913
913 914
914 void SkDeferredCanvas::drawBitmapMatrix(const SkBitmap& bitmap, 915 void SkDeferredCanvas::drawBitmapMatrix(const SkBitmap& bitmap,
915 const SkMatrix& m, 916 const SkMatrix& m,
916 const SkPaint* paint) { 917 const SkPaint* paint) {
917 // TODO: reset recording canvas if paint+bitmap is opaque and clip rect 918 // TODO: reset recording canvas if paint+bitmap is opaque and clip rect
918 // covers canvas entirely and transformed bitmap covers canvas entirely 919 // covers canvas entirely and transformed bitmap covers canvas entirely
919 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); 920 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { 1008 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) {
1008 this->drawingCanvas()->setDrawFilter(filter); 1009 this->drawingCanvas()->setDrawFilter(filter);
1009 this->INHERITED::setDrawFilter(filter); 1010 this->INHERITED::setDrawFilter(filter);
1010 this->recordedDrawCommand(); 1011 this->recordedDrawCommand();
1011 return filter; 1012 return filter;
1012 } 1013 }
1013 1014
1014 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { 1015 SkCanvas* SkDeferredCanvas::canvasForDrawIter() {
1015 return this->drawingCanvas(); 1016 return this->drawingCanvas();
1016 } 1017 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698