Check all scratch texture allocations for image filters.
BUG=403677 R=bsalomon@google.com NOTREECHECKS=true Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/473283002
This commit is contained in:
parent
cccb3b44e4
commit
673d9732bf
@ -256,6 +256,9 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont
|
||||
desc.fConfig = kRGBA_8888_GrPixelConfig;
|
||||
|
||||
GrAutoScratchTexture dst(context, desc);
|
||||
if (NULL == dst.texture()) {
|
||||
return false;
|
||||
}
|
||||
GrContext::AutoMatrix am;
|
||||
am.setIdentity(context);
|
||||
GrContext::AutoRenderTarget art(context, dst.texture()->asRenderTarget());
|
||||
|
@ -389,6 +389,9 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src,
|
||||
desc.fConfig = kSkia8888_GrPixelConfig;
|
||||
|
||||
GrAutoScratchTexture ast(context, desc);
|
||||
if (NULL == ast.texture()) {
|
||||
return false;
|
||||
}
|
||||
SkAutoTUnref<GrTexture> dst(ast.detach());
|
||||
|
||||
GrContext::AutoRenderTarget art(context, dst->asRenderTarget());
|
||||
|
@ -506,6 +506,9 @@ bool apply_morphology(const SkBitmap& input,
|
||||
|
||||
if (radius.fWidth > 0) {
|
||||
GrAutoScratchTexture ast(context, desc);
|
||||
if (NULL == ast.texture()) {
|
||||
return false;
|
||||
}
|
||||
GrContext::AutoRenderTarget art(context, ast.texture()->asRenderTarget());
|
||||
apply_morphology_pass(context, src, srcRect, dstRect, radius.fWidth,
|
||||
morphType, Gr1DKernelEffect::kX_Direction);
|
||||
@ -519,6 +522,9 @@ bool apply_morphology(const SkBitmap& input,
|
||||
}
|
||||
if (radius.fHeight > 0) {
|
||||
GrAutoScratchTexture ast(context, desc);
|
||||
if (NULL == ast.texture()) {
|
||||
return false;
|
||||
}
|
||||
GrContext::AutoRenderTarget art(context, ast.texture()->asRenderTarget());
|
||||
apply_morphology_pass(context, src, srcRect, dstRect, radius.fHeight,
|
||||
morphType, Gr1DKernelEffect::kY_Direction);
|
||||
|
@ -132,6 +132,9 @@ bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy,
|
||||
desc.fConfig = kSkia8888_GrPixelConfig;
|
||||
|
||||
GrAutoScratchTexture ast(context, desc);
|
||||
if (NULL == ast.texture()) {
|
||||
return false;
|
||||
}
|
||||
SkAutoTUnref<GrTexture> dst(ast.detach());
|
||||
|
||||
GrContext::AutoRenderTarget art(context, dst->asRenderTarget());
|
||||
|
Loading…
Reference in New Issue
Block a user