Rename non-aa rect methods on GrDrawContext in anticipation of making them support aa

R=joshualitt@google.com

Review URL: https://codereview.chromium.org/1409753008
This commit is contained in:
bsalomon 2015-11-05 10:41:43 -08:00 committed by Commit bot
parent cd49541524
commit a2e69fcded
11 changed files with 63 additions and 63 deletions

View File

@ -111,27 +111,27 @@ public:
const GrStrokeInfo* strokeInfo = NULL);
/**
* Maps a rectangle of shader coordinates to a rectangle and draws that rectangle
* Maps a rectangle of shader coordinates to a rectangle and fills that rectangle.
*
* @param paint describes how to color pixels.
* @param viewMatrix transformation matrix which applies to rectToDraw
* @param rectToDraw the rectangle to draw
* @param localRect the rectangle of shader coordinates applied to rectToDraw
*/
void drawNonAARectToRect(const GrClip&,
const GrPaint& paint,
const SkMatrix& viewMatrix,
const SkRect& rectToDraw,
const SkRect& localRect);
void fillRectToRect(const GrClip&,
const GrPaint& paint,
const SkMatrix& viewMatrix,
const SkRect& rectToDraw,
const SkRect& localRect);
/**
* Draws a non-AA rect with paint and a localMatrix
* Fills a rect with a paint and a localMatrix.
*/
void drawNonAARectWithLocalMatrix(const GrClip& clip,
const GrPaint& paint,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkMatrix& localMatrix);
void fillRectWithLocalMatrix(const GrClip& clip,
const GrPaint& paint,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkMatrix& localMatrix);
/**
* Draw a roundrect using a paint.

View File

@ -380,7 +380,7 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont
SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(dst->asRenderTarget()));
if (drawContext) {
drawContext->drawNonAARectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
WrapTexture(dst, bounds.width(), bounds.height(), result);
return true;

View File

@ -893,7 +893,7 @@ bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrTextureProvider* texProvider,
return false;
}
drawContext->drawNonAARectWithLocalMatrix(clip, *grp, SkMatrix::I(), rect, inverse);
drawContext->fillRectWithLocalMatrix(clip, *grp, SkMatrix::I(), rect, inverse);
return true;
}
@ -1174,7 +1174,7 @@ bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrTextureProvider* texProvid
return false;
}
drawContext->drawNonAARectWithLocalMatrix(clip, *grp, SkMatrix::I(), proxyRect, inverse);
drawContext->fillRectWithLocalMatrix(clip, *grp, SkMatrix::I(), proxyRect, inverse);
return true;
}

View File

@ -60,7 +60,7 @@ static void convolve_gaussian_1d(GrDrawContext* drawContext,
texture, direction, radius, sigma, useBounds, bounds));
paint.addColorFragmentProcessor(conv);
SkMatrix localMatrix = SkMatrix::MakeTrans(srcOffset.x(), srcOffset.y());
drawContext->drawNonAARectWithLocalMatrix(clip, paint, SkMatrix::I(), dstRect, localMatrix);
drawContext->fillRectWithLocalMatrix(clip, paint, SkMatrix::I(), dstRect, localMatrix);
}
static void convolve_gaussian_2d(GrDrawContext* drawContext,
@ -83,7 +83,7 @@ static void convolve_gaussian_2d(GrDrawContext* drawContext,
useBounds ? GrTextureDomain::kClamp_Mode : GrTextureDomain::kIgnore_Mode,
true, sigmaX, sigmaY));
paint.addColorFragmentProcessor(conv);
drawContext->drawNonAARectWithLocalMatrix(clip, paint, SkMatrix::I(), dstRect, localMatrix);
drawContext->fillRectWithLocalMatrix(clip, paint, SkMatrix::I(), dstRect, localMatrix);
}
static void convolve_gaussian(GrDrawContext* drawContext,
@ -222,7 +222,7 @@ GrTexture* GaussianBlur(GrContext* context,
if (!dstDrawContext) {
return nullptr;
}
dstDrawContext->drawNonAARectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
dstDrawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
srcDrawContext.swap(dstDrawContext);
srcRect = dstRect;
@ -345,7 +345,7 @@ GrTexture* GaussianBlur(GrContext* context,
if (!dstDrawContext) {
return nullptr;
}
dstDrawContext->drawNonAARectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
dstDrawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
srcDrawContext.swap(dstDrawContext);
srcRect = dstRect;

View File

@ -353,7 +353,7 @@ void SkLightingImageFilterInternal::drawRect(GrDrawContext* drawContext,
GrPaint paint;
GrFragmentProcessor* fp = this->getFragmentProcessor(src, matrix, bounds, boundaryMode);
paint.addColorFragmentProcessor(fp)->unref();
drawContext->drawNonAARectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
}
bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy,

View File

@ -477,7 +477,7 @@ void apply_morphology_rect(GrDrawContext* drawContext,
radius,
morphType,
bounds))->unref();
drawContext->drawNonAARectToRect(clip, paint, SkMatrix::I(), SkRect::Make(dstRect),
drawContext->fillRectToRect(clip, paint, SkMatrix::I(), SkRect::Make(dstRect),
SkRect::Make(srcRect));
}
@ -494,8 +494,8 @@ void apply_morphology_rect_no_bounds(GrDrawContext* drawContext,
direction,
radius,
morphType))->unref();
drawContext->drawNonAARectToRect(clip, paint, SkMatrix::I(), SkRect::Make(dstRect),
SkRect::Make(srcRect));
drawContext->fillRectToRect(clip, paint, SkMatrix::I(), SkRect::Make(dstRect),
SkRect::Make(srcRect));
}
void apply_morphology_pass(GrDrawContext* drawContext,

View File

@ -42,7 +42,7 @@ static bool draw_mask(GrDrawContext* drawContext,
if (!viewMatrix.invert(&inverse)) {
return false;
}
drawContext->drawNonAARectWithLocalMatrix(clip, *grp, SkMatrix::I(), maskRect, inverse);
drawContext->fillRectWithLocalMatrix(clip, *grp, SkMatrix::I(), maskRect, inverse);
return true;
}

View File

@ -322,11 +322,11 @@ void GrDrawContext::drawRect(const GrClip& clip,
}
}
void GrDrawContext::drawNonAARectToRect(const GrClip& clip,
const GrPaint& paint,
const SkMatrix& viewMatrix,
const SkRect& rectToDraw,
const SkRect& localRect) {
void GrDrawContext::fillRectToRect(const GrClip& clip,
const GrPaint& paint,
const SkMatrix& viewMatrix,
const SkRect& rectToDraw,
const SkRect& localRect) {
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
@ -340,11 +340,11 @@ void GrDrawContext::drawNonAARectToRect(const GrClip& clip,
localRect);
}
void GrDrawContext::drawNonAARectWithLocalMatrix(const GrClip& clip,
const GrPaint& paint,
const SkMatrix& viewMatrix,
const SkRect& rectToDraw,
const SkMatrix& localMatrix) {
void GrDrawContext::fillRectWithLocalMatrix(const GrClip& clip,
const GrPaint& paint,
const SkMatrix& viewMatrix,
const SkRect& rectToDraw,
const SkMatrix& localMatrix) {
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)

View File

@ -114,7 +114,7 @@ static GrTexture* copy_on_gpu(GrTexture* inputTexture, const SkIRect* subset,
}
SkRect dstRect = SkRect::MakeWH(SkIntToScalar(rtDesc.fWidth), SkIntToScalar(rtDesc.fHeight));
drawContext->drawNonAARectToRect(GrClip::WideOpen(), paint, SkMatrix::I(), dstRect, localRect);
drawContext->fillRectToRect(GrClip::WideOpen(), paint, SkMatrix::I(), dstRect, localRect);
return copy.detach();
}

View File

@ -1384,7 +1384,7 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
// matrices directly on the texture processor.
fDrawContext->drawRect(fClip, grPaint, viewMatrix, dstRect);
} else {
fDrawContext->drawNonAARectToRect(fClip, grPaint, viewMatrix, dstRect, paintRect);
fDrawContext->fillRectToRect(fClip, grPaint, viewMatrix, dstRect, paintRect);
}
}
@ -1466,17 +1466,17 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
return;
}
fDrawContext->drawNonAARectToRect(fClip,
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()));
fDrawContext->fillRectToRect(fClip,
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,
@ -1596,7 +1596,7 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device,
SkRect srcRect = SkRect::MakeWH(SK_Scalar1 * w / devTex->width(),
SK_Scalar1 * h / devTex->height());
fDrawContext->drawNonAARectToRect(fClip, grPaint, SkMatrix::I(), dstRect, srcRect);
fDrawContext->fillRectToRect(fClip, grPaint, SkMatrix::I(), dstRect, srcRect);
}
bool SkGpuDevice::canHandleImageFilter(const SkImageFilter* filter) {

View File

@ -231,11 +231,11 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
break;
}
readDrawContext->drawNonAARectToRect(GrClip::WideOpen(),
paint1,
SkMatrix::I(),
kDstRect,
kSrcRect);
readDrawContext->fillRectToRect(GrClip::WideOpen(),
paint1,
SkMatrix::I(),
kDstRect,
kSrcRect);
readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, firstRead);
@ -247,11 +247,11 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
failed = true;
break;
}
tempDrawContext->drawNonAARectToRect(GrClip::WideOpen(),
paint2,
SkMatrix::I(),
kDstRect,
kSrcRect);
tempDrawContext->fillRectToRect(GrClip::WideOpen(),
paint2,
SkMatrix::I(),
kDstRect,
kSrcRect);
paint3.addColorFragmentProcessor(pmToUPM2);
@ -261,11 +261,11 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
break;
}
readDrawContext->drawNonAARectToRect(GrClip::WideOpen(),
paint3,
SkMatrix::I(),
kDstRect,
kSrcRect);
readDrawContext->fillRectToRect(GrClip::WideOpen(),
paint3,
SkMatrix::I(),
kDstRect,
kSrcRect);
readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, secondRead);