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

Unified Diff: src/core/SkImageFilter.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: 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
Index: src/core/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 0a5e16e1d7a54d44640a0ff86cc5c343cb4dea42..8694fc557e66488c32538fddef2a253d83df1ca1 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -10,6 +10,7 @@
#include "SkBitmap.h"
#include "SkChecksum.h"
#include "SkDevice.h"
+#include "GrDrawContext.h"
#include "SkLazyPtr.h"
#include "SkMatrixImageFilter.h"
#include "SkReadBuffer.h"
@@ -276,11 +277,15 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont
SkASSERT(fp);
GrPaint paint;
paint.addColorProcessor(fp)->unref();
- context->drawNonAARectToRect(dst->asRenderTarget(), clip, paint, SkMatrix::I(), dstRect,
- srcRect);
- WrapTexture(dst, bounds.width(), bounds.height(), result);
- return true;
+ GrDrawContext* drawContext = context->drawContext();
+ if (drawContext) {
+ drawContext->drawNonAARectToRect(dst->asRenderTarget(), clip, paint, SkMatrix::I(),
+ dstRect, srcRect);
+
+ WrapTexture(dst, bounds.width(), bounds.height(), result);
+ return true;
+ }
}
#endif
return false;

Powered by Google App Engine
This is Rietveld 408576698