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

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: Addressed pipe-specific issues and updated to ToT 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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 } 886 }
887 887
888 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); 888 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint);
889 this->drawingCanvas()->drawBitmap(bitmap, left, top, paint); 889 this->drawingCanvas()->drawBitmap(bitmap, left, top, paint);
890 this->recordedDrawCommand(); 890 this->recordedDrawCommand();
891 } 891 }
892 892
893 void SkDeferredCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, 893 void SkDeferredCanvas::drawBitmapRectToRect(const SkBitmap& bitmap,
894 const SkRect* src, 894 const SkRect* src,
895 const SkRect& dst, 895 const SkRect& dst,
896 const SkPaint* paint) { 896 const SkPaint* paint,
897 DrawBitmapRectFlags flags) {
897 if (fDeferredDrawing && 898 if (fDeferredDrawing &&
898 this->isFullFrame(&dst, paint) && 899 this->isFullFrame(&dst, paint) &&
899 isPaintOpaque(paint, &bitmap)) { 900 isPaintOpaque(paint, &bitmap)) {
900 this->getDeferredDevice()->skipPendingCommands(); 901 this->getDeferredDevice()->skipPendingCommands();
901 } 902 }
902 903
903 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); 904 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint);
904 this->drawingCanvas()->drawBitmapRectToRect(bitmap, src, dst, paint); 905 this->drawingCanvas()->drawBitmapRectToRect(bitmap, src, dst, paint, flags);
905 this->recordedDrawCommand(); 906 this->recordedDrawCommand();
906 } 907 }
907 908
908 909
909 void SkDeferredCanvas::drawBitmapMatrix(const SkBitmap& bitmap, 910 void SkDeferredCanvas::drawBitmapMatrix(const SkBitmap& bitmap,
910 const SkMatrix& m, 911 const SkMatrix& m,
911 const SkPaint* paint) { 912 const SkPaint* paint) {
912 // TODO: reset recording canvas if paint+bitmap is opaque and clip rect 913 // TODO: reset recording canvas if paint+bitmap is opaque and clip rect
913 // covers canvas entirely and transformed bitmap covers canvas entirely 914 // covers canvas entirely and transformed bitmap covers canvas entirely
914 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); 915 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { 1003 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) {
1003 this->drawingCanvas()->setDrawFilter(filter); 1004 this->drawingCanvas()->setDrawFilter(filter);
1004 this->INHERITED::setDrawFilter(filter); 1005 this->INHERITED::setDrawFilter(filter);
1005 this->recordedDrawCommand(); 1006 this->recordedDrawCommand();
1006 return filter; 1007 return filter;
1007 } 1008 }
1008 1009
1009 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { 1010 SkCanvas* SkDeferredCanvas::canvasForDrawIter() {
1010 return this->drawingCanvas(); 1011 return this->drawingCanvas();
1011 } 1012 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698