post-commit fixes to applyFilter CL
BUG=skia:
Review URL: https://codereview.chromium.org/1404483002
diff --git a/include/core/SkImage.h b/include/core/SkImage.h
index 9e3810c..667cf6b 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -315,10 +315,10 @@
*
* e.g.
* If the filter makes the result larger by a margin of 4 the output would be:
- * result->width() = this->width + 8
- * result->height() = this->height + 8
- * offset.x() == -4
- * offset.y() == -4
+ * result->width() == this->width + 8
+ * result->height() == this->height + 8
+ * offset.x() == -4
+ * offset.y() == -4
*
* If the filter fails to create a resulting image, null is returned, and the offset parameter
* (if specified) will be undefined.
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index 326ae5b..0595010 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -115,7 +115,7 @@
// Returns true if the proxy handled the filter itself. If this returns
// false then the filter's code will be called.
bool filterImage(const SkImageFilter*, const SkBitmap& src, const SkImageFilter::Context&,
- SkBitmap* result, SkIPoint* offset) override;
+ SkBitmap* result, SkIPoint* offset) override;
private:
SkBaseDevice* fDevice;
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 529df3a..f7a73b9 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -186,7 +186,6 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#include "SkBitmapDevice.h"
#include "SkGrPixelRef.h"
#include "SkImageFilter.h"
@@ -227,11 +226,8 @@
return this->INHERITED::onApplyFilter(filter, offsetResult, forceResultToOriginalSize);
}
- const SkImageInfo info = make_info(this->width(), this->height(), this->isOpaque());
- SkAutoTUnref<SkGrPixelRef> pr(new SkGrPixelRef(info, fTexture));
SkBitmap src;
- src.setInfo(info);
- src.setPixelRef(pr, 0, 0);
+ GrWrapTextureInBitmap(fTexture, this->width(), this->height(), this->isOpaque(), &src);
GrContext* context = fTexture->getContext();
SkGpuImageFilterProxy proxy(context);
@@ -241,7 +237,7 @@
SkBitmap dst;
if (filter->filterImageGPU(&proxy, src, ctx, &dst, offsetResult)) {
- return new SkImage_Gpu(dst.width(), dst.height(), kNeedNewImageUniqueID, info.alphaType(),
+ return new SkImage_Gpu(dst.width(), dst.height(), kNeedNewImageUniqueID, dst.alphaType(),
dst.getTexture(), SkSurface::kNo_Budgeted);
}
return nullptr;