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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 812063002: Change to create device coord coordset (Closed) Base URL: https://skia.googlesource.com/skia.git@vm-off-context
Patch Set: ignoring bleed Created 6 years 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/gpu/GrContext.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 040cea83561e3abb2c5f277c3f55b34aa4367e74..5f4713245ebb8a7e77b90db68106ac417d6ad84d 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -574,16 +574,18 @@ namespace {
// Return true if the mask was successfully drawn.
bool draw_mask(GrContext* context, const SkMatrix& viewMatrix, const SkRect& maskRect,
GrPaint* grp, GrTexture* mask) {
- if (!grp->localCoordChangeInverse(viewMatrix)) {
- return false;
- }
-
SkMatrix matrix;
matrix.setTranslate(-maskRect.fLeft, -maskRect.fTop);
matrix.postIDiv(mask->width(), mask->height());
- grp->addCoverageProcessor(GrSimpleTextureEffect::Create(mask, matrix))->unref();
- context->drawRect(*grp, SkMatrix::I(), maskRect);
+ grp->addCoverageProcessor(GrSimpleTextureEffect::Create(mask, matrix,
+ kDevice_GrCoordSet))->unref();
+
+ SkMatrix inverse;
+ if (!viewMatrix.invert(&inverse)) {
+ return false;
+ }
+ context->drawNonAARectWithLocalMatrix(*grp, SkMatrix::I(), maskRect, inverse);
return true;
}
@@ -1381,7 +1383,7 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
SkColor2GrColor(paint.getColor());
SkPaint2GrPaintNoShader(this->context(), paint, paintColor, false, &grPaint);
- fContext->drawRectToRect(grPaint, viewMatrix, dstRect, paintRect);
+ fContext->drawNonAARectToRect(grPaint, viewMatrix, dstRect, paintRect);
}
bool SkGpuDevice::filterTexture(GrContext* context, GrTexture* texture,
@@ -1452,16 +1454,16 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
SkPaint2GrPaintNoShader(this->context(), paint, SkColor2GrColorJustAlpha(paint.getColor()),
false, &grPaint);
- fContext->drawRectToRect(grPaint,
- SkMatrix::I(),
- SkRect::MakeXYWH(SkIntToScalar(left),
- SkIntToScalar(top),
- SkIntToScalar(w),
- SkIntToScalar(h)),
- SkRect::MakeXYWH(0,
- 0,
- SK_Scalar1 * w / texture->width(),
- SK_Scalar1 * h / texture->height()));
+ fContext->drawNonAARectToRect(grPaint,
+ SkMatrix::I(),
+ SkRect::MakeXYWH(SkIntToScalar(left),
+ SkIntToScalar(top),
+ SkIntToScalar(w),
+ SkIntToScalar(h)),
+ SkRect::MakeXYWH(0,
+ 0,
+ SK_Scalar1 * w / texture->width(),
+ SK_Scalar1 * h / texture->height()));
}
void SkGpuDevice::drawBitmapRect(const SkDraw& origDraw, const SkBitmap& bitmap,
@@ -1574,7 +1576,7 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device,
SkRect srcRect = SkRect::MakeWH(SK_Scalar1 * w / devTex->width(),
SK_Scalar1 * h / devTex->height());
- fContext->drawRectToRect(grPaint, SkMatrix::I(), dstRect, srcRect);
+ fContext->drawNonAARectToRect(grPaint, SkMatrix::I(), dstRect, srcRect);
}
bool SkGpuDevice::canHandleImageFilter(const SkImageFilter* filter) {
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698