diff options
author | fmalita <fmalita@chromium.org> | 2014-11-20 10:44:58 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-20 10:44:58 -0800 |
commit | 2d97bc139a7de5813468bd3dbfd0037351ae5606 (patch) | |
tree | afc63f2cb5cfaf55d4b2588963fc3b91673c5786 /src/gpu | |
parent | d6ab2a8e45f6c473c076a828aa401919d7519d05 (diff) |
Disable LCD text explicitly in SkPictureImageFilter::onFilterImage()
As an intermediate fix for
https://code.google.com/p/skia/issues/detail?id=3142, we can use a
non-public SkCanvas constructor and force-disable LCD text.
BUG=skia:3142
R=reed@google.com,senorblanco@google.com
Review URL: https://codereview.chromium.org/725243004
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 23 | ||||
-rw-r--r-- | src/gpu/SkGpuDevice.h | 4 |
2 files changed, 17 insertions, 10 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 34964d53d6..ca79d0a2d1 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1348,12 +1348,15 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap, fContext->drawRectToRect(grPaint, dstRect, paintRect); } -static bool filter_texture(SkBaseDevice* device, GrContext* context, - GrTexture* texture, const SkImageFilter* filter, - const SkImageFilter::Context& ctx, - SkBitmap* result, SkIPoint* offset) { +bool SkGpuDevice::filterTexture(GrContext* context, GrTexture* texture, + const SkImageFilter* filter, + const SkImageFilter::Context& ctx, + SkBitmap* result, SkIPoint* offset) { SkASSERT(filter); - SkDeviceImageFilterProxy proxy(device); + + // FIXME: plumb actual surface props such that we don't have to lie about the flags here + // (https://code.google.com/p/skia/issues/detail?id=3148). + SkDeviceImageFilterProxy proxy(this, SkSurfaceProps(0, getLeakyProperties().pixelGeometry())); if (filter->canFilterImageGPU()) { // Save the render target and set it to NULL, so we don't accidentally draw to it in the @@ -1395,8 +1398,8 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap, // This cache is transient, and is freed (along with all its contained // textures) when it goes out of scope. SkImageFilter::Context ctx(matrix, clipBounds, cache); - if (filter_texture(this, fContext, texture, filter, ctx, &filteredBitmap, - &offset)) { + if (this->filterTexture(fContext, texture, filter, ctx, &filteredBitmap, + &offset)) { texture = (GrTexture*) filteredBitmap.getTexture(); w = filteredBitmap.width(); h = filteredBitmap.height(); @@ -1506,8 +1509,8 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device, // textures) when it goes out of scope. SkAutoTUnref<SkImageFilter::Cache> cache(getImageFilterCache()); SkImageFilter::Context ctx(matrix, clipBounds, cache); - if (filter_texture(this, fContext, devTex, filter, ctx, &filteredBitmap, - &offset)) { + if (this->filterTexture(fContext, devTex, filter, ctx, &filteredBitmap, + &offset)) { devTex = filteredBitmap.getTexture(); w = filteredBitmap.width(); h = filteredBitmap.height(); @@ -1559,7 +1562,7 @@ bool SkGpuDevice::filterImage(const SkImageFilter* filter, const SkBitmap& src, // must be pushed upstack. AutoBitmapTexture abt(fContext, src, NULL, &texture); - return filter_texture(this, fContext, texture, filter, ctx, result, offset); + return this->filterTexture(fContext, texture, filter, ctx, result, offset); } /////////////////////////////////////////////////////////////////////////////// diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h index ef31276d49..bb6cb487b0 100644 --- a/src/gpu/SkGpuDevice.h +++ b/src/gpu/SkGpuDevice.h @@ -202,6 +202,10 @@ private: bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); + bool filterTexture(GrContext*, GrTexture*, const SkImageFilter*, + const SkImageFilter::Context&, + SkBitmap* result, SkIPoint* offset); + static SkPicture::AccelData::Key ComputeAccelDataKey(); typedef SkBaseDevice INHERITED; |