Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(875)

Unified Diff: src/effects/SkDisplacementMapEffect.cpp

Issue 1151283004: Split drawing functionality out of GrContext and into new GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix no-GPU builds Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkGpuBlurUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkDisplacementMapEffect.cpp
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 23202e2c3f097bb94991ffceec293a20c68dded4..d7d92c82b9476487ed009011cb02e8f973064e79 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -12,6 +12,7 @@
#include "SkColorPriv.h"
#if SK_SUPPORT_GPU
#include "GrContext.h"
+#include "GrDrawContext.h"
#include "GrCoordTransform.h"
#include "GrInvariantOutput.h"
#include "effects/GrTextureDomain.h"
@@ -457,8 +458,14 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src,
SkMatrix matrix;
matrix.setTranslate(-SkIntToScalar(colorBounds.x()),
-SkIntToScalar(colorBounds.y()));
- context->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, matrix,
- SkRect::Make(colorBounds));
+
+ GrDrawContext* drawContext = context->drawContext();
+ if (!drawContext) {
+ return false;
+ }
+
+ drawContext->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, matrix,
+ SkRect::Make(colorBounds));
offset->fX = bounds.left();
offset->fY = bounds.top();
WrapTexture(dst, bounds.width(), bounds.height(), result);
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkGpuBlurUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698