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

Unified Diff: src/gpu/effects/GrConfigConversionEffect.cpp

Issue 1245183002: Misc cleanup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address gcc complaint Created 5 years, 5 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
« src/effects/SkMorphologyImageFilter.cpp ('K') | « src/gpu/SkGpuDevice.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 fa97f324be1be16138ffe1826698e4e979a1a38d..82ac5df081904b18b032b69d7a8f7d7830a2d5a1 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -207,11 +207,6 @@ 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];
@@ -239,30 +234,51 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
SkMatrix::I())));
paint1.addColorProcessor(pmToUPM1);
- drawContext->drawNonAARectToRect(readTex->asRenderTarget(),
- GrClip::WideOpen(),
- paint1,
- SkMatrix::I(),
- kDstRect,
- kSrcRect);
+
+
+ GrDrawContext* readDrawContext = context->drawContext();
+ if (!readDrawContext) {
+ failed = true;
+ break;
+ }
+
+ readDrawContext->drawNonAARectToRect(readTex->asRenderTarget(),
+ GrClip::WideOpen(),
+ paint1,
+ SkMatrix::I(),
+ kDstRect,
+ kSrcRect);
readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, firstRead);
paint2.addColorProcessor(upmToPM);
- drawContext->drawNonAARectToRect(tempTex->asRenderTarget(),
- GrClip::WideOpen(),
- paint2,
- SkMatrix::I(),
- kDstRect,
- kSrcRect);
+
+ GrDrawContext* tempDrawContext = context->drawContext();
+ if (!tempDrawContext) {
+ failed = true;
+ break;
+ }
+ tempDrawContext->drawNonAARectToRect(tempTex->asRenderTarget(),
+ GrClip::WideOpen(),
+ paint2,
+ SkMatrix::I(),
+ kDstRect,
+ kSrcRect);
paint3.addColorProcessor(pmToUPM2);
- drawContext->drawNonAARectToRect(readTex->asRenderTarget(),
- GrClip::WideOpen(),
- paint3,
- SkMatrix::I(),
- kDstRect,
- kSrcRect);
+
+ readDrawContext = context->drawContext();
+ if (!readDrawContext) {
+ failed = true;
+ break;
+ }
+
+ readDrawContext->drawNonAARectToRect(readTex->asRenderTarget(),
+ GrClip::WideOpen(),
+ paint3,
+ SkMatrix::I(),
+ kDstRect,
+ kSrcRect);
readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, secondRead);
« src/effects/SkMorphologyImageFilter.cpp ('K') | « src/gpu/SkGpuDevice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698