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

Unified Diff: src/gpu/effects/GrConfigConversionEffect.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/gpu/SkGr.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrConfigConversionEffect.cpp
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 9a6f9fcd9b202e596c9f55138ab40e8816299f68..d5b8a18e885b317984b9808a3fbf8384dd99eec4 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -7,6 +7,7 @@
#include "GrConfigConversionEffect.h"
#include "GrContext.h"
+#include "GrDrawContext.h"
#include "GrInvariantOutput.h"
#include "GrSimpleTextureEffect.h"
#include "SkMatrix.h"
@@ -207,6 +208,11 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
bool failed = true;
+ GrDrawContext* drawContext = context->drawContext();
+ if (!drawContext) {
+ return;
+ }
+
for (size_t i = 0; i < SK_ARRAY_COUNT(kConversionRules) && failed; ++i) {
*pmToUPMRule = kConversionRules[i][0];
*upmToPMRule = kConversionRules[i][1];
@@ -229,32 +235,32 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
GrPaint paint1;
paint1.addColorProcessor(pmToUPM1);
- context->drawNonAARectToRect(readTex->asRenderTarget(),
- GrClip::WideOpen(),
- paint1,
- SkMatrix::I(),
- kDstRect,
- kSrcRect);
+ drawContext->drawNonAARectToRect(readTex->asRenderTarget(),
+ GrClip::WideOpen(),
+ paint1,
+ SkMatrix::I(),
+ kDstRect,
+ kSrcRect);
readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, firstRead);
GrPaint paint2;
paint2.addColorProcessor(upmToPM);
- context->drawNonAARectToRect(tempTex->asRenderTarget(),
- GrClip::WideOpen(),
- paint2,
- SkMatrix::I(),
- kDstRect,
- kSrcRect);
+ drawContext->drawNonAARectToRect(tempTex->asRenderTarget(),
+ GrClip::WideOpen(),
+ paint2,
+ SkMatrix::I(),
+ kDstRect,
+ kSrcRect);
GrPaint paint3;
paint3.addColorProcessor(pmToUPM2);
- context->drawNonAARectToRect(readTex->asRenderTarget(),
- GrClip::WideOpen(),
- paint3,
- SkMatrix::I(),
- kDstRect,
- kSrcRect);
+ drawContext->drawNonAARectToRect(readTex->asRenderTarget(),
+ GrClip::WideOpen(),
+ paint3,
+ SkMatrix::I(),
+ kDstRect,
+ kSrcRect);
readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, secondRead);
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698