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

Side by Side Diff: src/gpu/effects/GrConfigConversionEffect.cpp

Issue 808703006: remove view matrix from context (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: one more fix Created 6 years 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 unified diff | Download patch
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrConfigConversionEffect.h" 8 #include "GrConfigConversionEffect.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrInvariantOutput.h" 10 #include "GrInvariantOutput.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 SkAutoTUnref<GrFragmentProcessor> upmToPM( 224 SkAutoTUnref<GrFragmentProcessor> upmToPM(
225 SkNEW_ARGS(GrConfigConversionEffect, 225 SkNEW_ARGS(GrConfigConversionEffect,
226 (readTex, false, *upmToPMRule, SkMatrix::I()))); 226 (readTex, false, *upmToPMRule, SkMatrix::I())));
227 SkAutoTUnref<GrFragmentProcessor> pmToUPM2( 227 SkAutoTUnref<GrFragmentProcessor> pmToUPM2(
228 SkNEW_ARGS(GrConfigConversionEffect, 228 SkNEW_ARGS(GrConfigConversionEffect,
229 (tempTex, false, *pmToUPMRule, SkMatrix::I()))); 229 (tempTex, false, *pmToUPMRule, SkMatrix::I())));
230 230
231 context->setRenderTarget(readTex->asRenderTarget()); 231 context->setRenderTarget(readTex->asRenderTarget());
232 GrPaint paint1; 232 GrPaint paint1;
233 paint1.addColorProcessor(pmToUPM1); 233 paint1.addColorProcessor(pmToUPM1);
234 context->drawRectToRect(paint1, kDstRect, kSrcRect); 234 context->drawRectToRect(paint1, SkMatrix::I(), kDstRect, kSrcRect);
235 235
236 readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, firstRead) ; 236 readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, firstRead) ;
237 237
238 context->setRenderTarget(tempTex->asRenderTarget()); 238 context->setRenderTarget(tempTex->asRenderTarget());
239 GrPaint paint2; 239 GrPaint paint2;
240 paint2.addColorProcessor(upmToPM); 240 paint2.addColorProcessor(upmToPM);
241 context->drawRectToRect(paint2, kDstRect, kSrcRect); 241 context->drawRectToRect(paint2, SkMatrix::I(), kDstRect, kSrcRect);
242 context->setRenderTarget(readTex->asRenderTarget()); 242 context->setRenderTarget(readTex->asRenderTarget());
243 243
244 GrPaint paint3; 244 GrPaint paint3;
245 paint3.addColorProcessor(pmToUPM2); 245 paint3.addColorProcessor(pmToUPM2);
246 context->drawRectToRect(paint3, kDstRect, kSrcRect); 246 context->drawRectToRect(paint3, SkMatrix::I(), kDstRect, kSrcRect);
247 247
248 readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, secondRead ); 248 readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, secondRead );
249 249
250 failed = false; 250 failed = false;
251 for (int y = 0; y < 256 && !failed; ++y) { 251 for (int y = 0; y < 256 && !failed; ++y) {
252 for (int x = 0; x <= y; ++x) { 252 for (int x = 0; x <= y; ++x) {
253 if (firstRead[256 * y + x] != secondRead[256 * y + x]) { 253 if (firstRead[256 * y + x] != secondRead[256 * y + x]) {
254 failed = true; 254 failed = true;
255 break; 255 break;
256 } 256 }
(...skipping 21 matching lines...) Expand all
278 kNone_PMConversion != pmConversion) { 278 kNone_PMConversion != pmConversion) {
279 // The PM conversions assume colors are 0..255 279 // The PM conversions assume colors are 0..255
280 return NULL; 280 return NULL;
281 } 281 }
282 return SkNEW_ARGS(GrConfigConversionEffect, (texture, 282 return SkNEW_ARGS(GrConfigConversionEffect, (texture,
283 swapRedAndBlue, 283 swapRedAndBlue,
284 pmConversion, 284 pmConversion,
285 matrix)); 285 matrix));
286 } 286 }
287 } 287 }
OLDNEW
« 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