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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1230813003: More threading of GrProcessorDataManager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks 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/gpu/GrSWMaskHelper.cpp ('k') | src/gpu/effects/Gr1DKernelEffect.h » ('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 028ab561f4f57f1d9b36fb19bae0bb767d328cf1..e0658b30f6ed6ae2003e4d66db01daf7f8ef2dad 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1206,7 +1206,12 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
SkScalarMul(srcRect.fBottom, hInv));
SkRect textureDomain = SkRect::MakeEmpty();
+
+ // Construct a GrPaint by setting the bitmap texture as the first effect and then configuring
+ // the rest from the SkPaint.
+ GrPaint grPaint;
SkAutoTUnref<GrFragmentProcessor> fp;
+
if (needsTextureDomain && !(flags & SkCanvas::kBleed_DrawBitmapRectFlag)) {
// Use a constrained texture domain to avoid color bleeding
SkScalar left, top, right, bottom;
@@ -1226,9 +1231,11 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
}
textureDomain.setLTRB(left, top, right, bottom);
if (bicubic) {
- fp.reset(GrBicubicEffect::Create(texture, SkMatrix::I(), textureDomain));
+ fp.reset(GrBicubicEffect::Create(grPaint.getProcessorDataManager(), texture,
+ SkMatrix::I(), textureDomain));
} else {
- fp.reset(GrTextureDomainEffect::Create(texture,
+ fp.reset(GrTextureDomainEffect::Create(grPaint.getProcessorDataManager(),
+ texture,
SkMatrix::I(),
textureDomain,
GrTextureDomain::kClamp_Mode,
@@ -1237,14 +1244,13 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
} else if (bicubic) {
SkASSERT(GrTextureParams::kNone_FilterMode == params.filterMode());
SkShader::TileMode tileModes[2] = { params.getTileModeX(), params.getTileModeY() };
- fp.reset(GrBicubicEffect::Create(texture, SkMatrix::I(), tileModes));
+ fp.reset(GrBicubicEffect::Create(grPaint.getProcessorDataManager(), texture, SkMatrix::I(),
+ tileModes));
} else {
- fp.reset(GrSimpleTextureEffect::Create(texture, SkMatrix::I(), params));
+ fp.reset(GrSimpleTextureEffect::Create(grPaint.getProcessorDataManager(), texture,
+ SkMatrix::I(), params));
}
- // Construct a GrPaint by setting the bitmap texture as the first effect and then configuring
- // the rest from the SkPaint.
- GrPaint grPaint;
grPaint.addColorProcessor(fp);
bool alphaOnly = !(kAlpha_8_SkColorType == bitmap.colorType());
GrColor paintColor = (alphaOnly) ? SkColor2GrColorJustAlpha(paint.getColor()) :
« no previous file with comments | « src/gpu/GrSWMaskHelper.cpp ('k') | src/gpu/effects/Gr1DKernelEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698