Split drawing functionality out of GrContext and into new GrDrawContext
This is mainly a mechanical CL. There were some fiddly bits in GrContext.cpp where it no longer had access to the GrDrawTarget (and had to use the new GrDrawContext).
I've converted GrAARectRenderer & GrOvalRenderer into static classes so I could stop allocating them.
Review URL: https://codereview.chromium.org/1151283004
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index 76c4629..f98247a 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -14,6 +14,7 @@
#include "SkXfermode.h"
#if SK_SUPPORT_GPU
#include "GrContext.h"
+#include "GrDrawContext.h"
#include "effects/GrTextureDomain.h"
#include "SkGr.h"
#endif
@@ -178,7 +179,14 @@
paint.addColorProcessor(foregroundDomain.get());
paint.addColorProcessor(xferProcessor)->unref();
- context->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, SkMatrix::I(), srcRect);
+
+ GrDrawContext* drawContext = context->drawContext();
+ if (!drawContext) {
+ return false;
+ }
+
+ drawContext->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint,
+ SkMatrix::I(), srcRect);
offset->fX = backgroundOffset.fX;
offset->fY = backgroundOffset.fY;