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

Unified Diff: src/utils/SkDeferredCanvas.cpp

Issue 1228853005: rename utility to see if a paint will overwrite its pixels (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPaintPriv.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkDeferredCanvas.cpp
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index 343d0c45d7c6fcf102396983c512580ecb5e77f3..5ff987e0adfd37705048bfbe2f68644421c8a4a6 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -791,8 +791,7 @@ void SkDeferredCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op)
}
void SkDeferredCanvas::onDrawPaint(const SkPaint& paint) {
- if (fDeferredDrawing && this->isFullFrame(NULL, &paint) &&
- isPaintOpaque(&paint)) {
+ if (fDeferredDrawing && this->isFullFrame(NULL, &paint) && SkPaintPriv::Overwrites(paint)) {
this->getDeferredDevice()->skipPendingCommands();
}
AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
@@ -814,8 +813,7 @@ void SkDeferredCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) {
}
void SkDeferredCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
- if (fDeferredDrawing && this->isFullFrame(&rect, &paint) &&
- isPaintOpaque(&paint)) {
+ if (fDeferredDrawing && this->isFullFrame(&rect, &paint) && SkPaintPriv::Overwrites(paint)) {
this->getDeferredDevice()->skipPendingCommands();
}
@@ -855,7 +853,7 @@ void SkDeferredCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar left,
SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height()));
if (fDeferredDrawing &&
this->isFullFrame(&bitmapRect, paint) &&
- isPaintOpaque(paint, &bitmap)) {
+ SkPaintPriv::Overwrites(bitmap, paint)) {
this->getDeferredDevice()->skipPendingCommands();
}
@@ -869,7 +867,7 @@ void SkDeferredCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* sr
SK_VIRTUAL_CONSTRAINT_TYPE constraint) {
if (fDeferredDrawing &&
this->isFullFrame(&dst, paint) &&
- isPaintOpaque(paint, &bitmap)) {
+ SkPaintPriv::Overwrites(bitmap, paint)) {
this->getDeferredDevice()->skipPendingCommands();
}
@@ -885,7 +883,7 @@ void SkDeferredCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y,
SkIntToScalar(image->width()), SkIntToScalar(image->height()));
if (fDeferredDrawing &&
this->isFullFrame(&bounds, paint) &&
- isPaintOpaque(paint, image)) {
+ SkPaintPriv::Overwrites(image, paint)) {
this->getDeferredDevice()->skipPendingCommands();
}
@@ -897,7 +895,7 @@ void SkDeferredCanvas::onDrawImageRect(const SkImage* image, const SkRect* src,
const SkPaint* paint SRC_RECT_CONSTRAINT_PARAM(constraint)) {
if (fDeferredDrawing &&
this->isFullFrame(&dst, paint) &&
- isPaintOpaque(paint, image)) {
+ SkPaintPriv::Overwrites(image, paint)) {
this->getDeferredDevice()->skipPendingCommands();
}
@@ -911,7 +909,7 @@ void SkDeferredCanvas::onDrawImageNine(const SkImage* image, const SkIRect& cent
const SkRect& dst, const SkPaint* paint) {
if (fDeferredDrawing &&
this->isFullFrame(&dst, paint) &&
- isPaintOpaque(paint, image)) {
+ SkPaintPriv::Overwrites(image, paint)) {
this->getDeferredDevice()->skipPendingCommands();
}
@@ -939,7 +937,7 @@ void SkDeferredCanvas::onDrawSprite(const SkBitmap& bitmap, int left, int top,
SkIntToScalar(bitmap.height()));
if (fDeferredDrawing &&
this->isFullFrame(&bitmapRect, paint) &&
- isPaintOpaque(paint, &bitmap)) {
+ SkPaintPriv::Overwrites(bitmap, paint)) {
this->getDeferredDevice()->skipPendingCommands();
}
« no previous file with comments | « src/core/SkPaintPriv.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698