#include "SkTemplates.h"
class GrFragmentProcessor;
+class GrShaderDataManager;
class GrTexture;
class SkBaseDevice;
class SkBitmap;
* will be called with (NULL, NULL, SkMatrix::I()) to query for support,
* so returning "true" indicates support for all possible matrices.
*/
- virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&,
- const SkIRect& bounds) const;
+ virtual bool asFragmentProcessor(GrFragmentProcessor**, GrShaderDataManager*, GrTexture*,
+ const SkMatrix&, const SkIRect& bounds) const;
private:
friend class SkGraphics;
SkMagnifierImageFilter(const SkRect& srcRect, SkScalar inset, SkImageFilter* input);
void flatten(SkWriteBuffer&) const override;
- virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
- SkBitmap* result, SkIPoint* offset) const override;
+ bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
+ SkBitmap* result, SkIPoint* offset) const override;
#if SK_SUPPORT_GPU
- virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&,
- const SkIRect& bounds) const override;
+ bool asFragmentProcessor(GrFragmentProcessor**, GrShaderDataManager*, GrTexture*,
+ const SkMatrix&, const SkIRect& bounds) const override;
#endif
private:
const CropRect* cropRect);
void flatten(SkWriteBuffer&) const override;
- virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
- SkBitmap* result, SkIPoint* loc) const override;
+ bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
+ SkBitmap* result, SkIPoint* loc) const override;
bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) const override;
#if SK_SUPPORT_GPU
- virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&,
- const SkIRect& bounds) const override;
+ bool asFragmentProcessor(GrFragmentProcessor**, GrShaderDataManager*, GrTexture*,
+ const SkMatrix&, const SkIRect& bounds) const override;
#endif
private:
}
bool SkImageFilter::canFilterImageGPU() const {
- return this->asFragmentProcessor(NULL, NULL, SkMatrix::I(), SkIRect());
+ return this->asFragmentProcessor(NULL, NULL, NULL, SkMatrix::I(), SkIRect());
}
bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
bounds.offset(-srcOffset);
SkMatrix matrix(ctx.ctm());
matrix.postTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top()));
- if (this->asFragmentProcessor(&fp, srcTexture, matrix, bounds)) {
+ GrPaint paint;
+ if (this->asFragmentProcessor(&fp, paint.getShaderDataManager(), srcTexture, matrix, bounds)) {
SkASSERT(fp);
- GrPaint paint;
paint.addColorProcessor(fp)->unref();
GrDrawContext* drawContext = context->drawContext();
return true;
}
-bool SkImageFilter::asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&,
- const SkIRect&) const {
+bool SkImageFilter::asFragmentProcessor(GrFragmentProcessor**, GrShaderDataManager*, GrTexture*,
+ const SkMatrix&, const SkIRect&) const {
return false;
}
bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* offset) const override;
#if SK_SUPPORT_GPU
- bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&,
- const SkIRect& bounds) const override;
+ bool asFragmentProcessor(GrFragmentProcessor**, GrShaderDataManager*, GrTexture*,
+ const SkMatrix&, const SkIRect& bounds) const override;
#endif
private:
#if SK_SUPPORT_GPU
bool SkAlphaThresholdFilterImpl::asFragmentProcessor(GrFragmentProcessor** fp,
+ GrShaderDataManager*,
GrTexture* texture,
const SkMatrix& in_matrix,
const SkIRect&) const {
}
#if SK_SUPPORT_GPU
-bool SkMagnifierImageFilter::asFragmentProcessor(GrFragmentProcessor** fp, GrTexture* texture,
- const SkMatrix&, const SkIRect&bounds) const {
+bool SkMagnifierImageFilter::asFragmentProcessor(GrFragmentProcessor** fp, GrShaderDataManager*,
+ GrTexture* texture, const SkMatrix&,
+ const SkIRect&bounds) const {
if (fp) {
SkScalar yOffset = texture->origin() == kTopLeft_GrSurfaceOrigin ? fSrcRect.y() :
texture->height() - fSrcRect.height() * texture->height() / bounds.height()
}
bool SkMatrixConvolutionImageFilter::asFragmentProcessor(GrFragmentProcessor** fp,
+ GrShaderDataManager*,
GrTexture* texture,
const SkMatrix&,
const SkIRect& bounds) const {