| Index: src/gpu/GrLayerHoister.cpp
|
| diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp
|
| index 70c10d7f69db1e62e84a60437406ed23d762c57e..224518e59c73a66c7fa278170db3c72dac2d5ef7 100644
|
| --- a/src/gpu/GrLayerHoister.cpp
|
| +++ b/src/gpu/GrLayerHoister.cpp
|
| @@ -5,15 +5,15 @@
|
| * found in the LICENSE file.
|
| */
|
|
|
| -#include "GrLayerCache.h"
|
| #include "GrLayerHoister.h"
|
| +#include "GrLayerCache.h"
|
| #include "GrRecordReplaceDraw.h"
|
| -
|
| #include "SkCanvas.h"
|
| #include "SkDeviceImageFilterProxy.h"
|
| #include "SkDeviceProperties.h"
|
| #include "SkGpuDevice.h"
|
| #include "SkGrPixelRef.h"
|
| +#include "SkImagePriv.h"
|
| #include "SkLayerInfo.h"
|
| #include "SkRecordDraw.h"
|
| #include "SkSurface.h"
|
| @@ -276,13 +276,13 @@ void GrLayerHoister::DrawLayersToAtlas(GrContext* context,
|
| }
|
| }
|
|
|
| -SkBitmap wrap_texture(GrTexture* texture) {
|
| +static SkImage* wrap_texture(GrTexture* texture) {
|
| SkASSERT(texture);
|
| -
|
| SkBitmap result;
|
| result.setInfo(texture->surfacePriv().info());
|
| result.setPixelRef(SkNEW_ARGS(SkGrPixelRef, (result.info(), texture)))->unref();
|
| - return result;
|
| + return SkNewImageFromBitmapTexture(result, texture->desc().fSampleCnt,
|
| + SkSurface::kYes_Budgeted);
|
| }
|
|
|
| void GrLayerHoister::FilterLayer(GrContext* context,
|
| @@ -294,7 +294,6 @@ void GrLayerHoister::FilterLayer(GrContext* context,
|
|
|
| static const int kDefaultCacheSize = 32 * 1024 * 1024;
|
|
|
| - SkBitmap filteredBitmap;
|
| SkIPoint offset = SkIPoint::Make(0, 0);
|
|
|
| const SkIPoint filterOffset = SkIPoint::Make(layer->srcIR().fLeft, layer->srcIR().fTop);
|
| @@ -313,15 +312,15 @@ void GrLayerHoister::FilterLayer(GrContext* context,
|
| SkImageFilter::Context filterContext(totMat, clipBounds, cache);
|
|
|
| SkDeviceImageFilterProxy proxy(device, SkSurfaceProps(0, kUnknown_SkPixelGeometry));
|
| - const SkBitmap src = wrap_texture(layer->texture());
|
| -
|
| - if (!layer->filter()->filterImage(&proxy, src, filterContext, &filteredBitmap, &offset)) {
|
| + SkAutoTUnref<const SkImage> src(wrap_texture(layer->texture()));
|
| + SkAutoTUnref<const SkImage> filteredImage;
|
| + if (!layer->filter()->filterImage(&proxy, src, filterContext, filteredImage, &offset)) {
|
| // Filtering failed. Press on with the unfiltered version.
|
| return;
|
| }
|
|
|
| - SkIRect newRect = SkIRect::MakeWH(filteredBitmap.width(), filteredBitmap.height());
|
| - layer->setTexture(filteredBitmap.getTexture(), newRect);
|
| + SkIRect newRect = SkIRect::MakeWH(filteredImage->width(), filteredImage->height());
|
| + layer->setTexture(filteredImage->getTexture(), newRect);
|
| layer->setOffset(offset);
|
| }
|
|
|
|
|