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

Side by Side Diff: tests/GrPorterDuffTest.cpp

Issue 1158453004: Revert of Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names. (Closed) Base URL: https://skia.googlesource.com/skia.git@copy
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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/builders/GrGLFragmentShaderBuilder.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 2015 Google Inc. 2 * Copyright 2015 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 "SkXfermode.h" 8 #include "SkXfermode.h"
9 #include "Test.h" 9 #include "Test.h"
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 kCanTweakAlphaForCoverage_OptFlag = GrXferProcessor::kCanTweakAlphaForCovera ge_OptFlag 69 kCanTweakAlphaForCoverage_OptFlag = GrXferProcessor::kCanTweakAlphaForCovera ge_OptFlag
70 }; 70 };
71 71
72 class GrPorterDuffTest { 72 class GrPorterDuffTest {
73 public: 73 public:
74 struct XPInfo { 74 struct XPInfo {
75 XPInfo(skiatest::Reporter* reporter, SkXfermode::Mode xfermode, const Gr Caps& caps, 75 XPInfo(skiatest::Reporter* reporter, SkXfermode::Mode xfermode, const Gr Caps& caps,
76 const GrProcOptInfo& colorPOI, const GrProcOptInfo& covPOI) { 76 const GrProcOptInfo& colorPOI, const GrProcOptInfo& covPOI) {
77 SkAutoTUnref<GrXPFactory> xpf(GrPorterDuffXPFactory::Create(xfermode )); 77 SkAutoTUnref<GrXPFactory> xpf(GrPorterDuffXPFactory::Create(xfermode ));
78 SkAutoTUnref<GrXferProcessor> xp(xpf->createXferProcessor(colorPOI, covPOI, 0, caps)); 78 SkAutoTUnref<GrXferProcessor> xp(xpf->createXferProcessor(colorPOI, covPOI, 0, caps));
79 TEST_ASSERT(!xpf->willNeedDstTexture(caps, colorPOI, covPOI)); 79 TEST_ASSERT(!xpf->willNeedDstCopy(caps, colorPOI, covPOI));
80 xpf->getInvariantOutput(colorPOI, covPOI, &fInvariantOutput); 80 xpf->getInvariantOutput(colorPOI, covPOI, &fInvariantOutput);
81 fOptFlags = xp->getOptimizations(colorPOI, covPOI, false, 0, caps); 81 fOptFlags = xp->getOptimizations(colorPOI, covPOI, false, 0, caps);
82 GetXPOutputTypes(xp, &fPrimaryOutputType, &fSecondaryOutputType); 82 GetXPOutputTypes(xp, &fPrimaryOutputType, &fSecondaryOutputType);
83 xp->getBlendInfo(&fBlendInfo); 83 xp->getBlendInfo(&fBlendInfo);
84 } 84 }
85 85
86 GrXPFactory::InvariantOutput fInvariantOutput; 86 GrXPFactory::InvariantOutput fInvariantOutput;
87 int fOptFlags; 87 int fOptFlags;
88 int fPrimaryOutputType; 88 int fPrimaryOutputType;
89 int fSecondaryOutputType; 89 int fSecondaryOutputType;
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 } testLCDCoverageBatch; 1304 } testLCDCoverageBatch;
1305 1305
1306 GrProcOptInfo colorPOI, covPOI; 1306 GrProcOptInfo colorPOI, covPOI;
1307 colorPOI.calcColorWithBatch(&testLCDCoverageBatch, NULL, 0); 1307 colorPOI.calcColorWithBatch(&testLCDCoverageBatch, NULL, 0);
1308 covPOI.calcCoverageWithBatch(&testLCDCoverageBatch, NULL, 0); 1308 covPOI.calcCoverageWithBatch(&testLCDCoverageBatch, NULL, 0);
1309 1309
1310 SkASSERT(kRGBA_GrColorComponentFlags == colorPOI.validFlags()); 1310 SkASSERT(kRGBA_GrColorComponentFlags == colorPOI.validFlags());
1311 SkASSERT(covPOI.isFourChannelOutput()); 1311 SkASSERT(covPOI.isFourChannelOutput());
1312 1312
1313 SkAutoTUnref<GrXPFactory> xpf(GrPorterDuffXPFactory::Create(SkXfermode::kSrc Over_Mode)); 1313 SkAutoTUnref<GrXPFactory> xpf(GrPorterDuffXPFactory::Create(SkXfermode::kSrc Over_Mode));
1314 TEST_ASSERT(!xpf->willNeedDstTexture(caps, colorPOI, covPOI)); 1314 TEST_ASSERT(!xpf->willNeedDstCopy(caps, colorPOI, covPOI));
1315 1315
1316 GrXPFactory::InvariantOutput invariantOutput; 1316 GrXPFactory::InvariantOutput invariantOutput;
1317 xpf->getInvariantOutput(colorPOI, covPOI, &invariantOutput); 1317 xpf->getInvariantOutput(colorPOI, covPOI, &invariantOutput);
1318 TEST_ASSERT(invariantOutput.fWillBlendWithDst); 1318 TEST_ASSERT(invariantOutput.fWillBlendWithDst);
1319 TEST_ASSERT(kNone_GrColorComponentFlags == invariantOutput.fBlendedColorFlag s); 1319 TEST_ASSERT(kNone_GrColorComponentFlags == invariantOutput.fBlendedColorFlag s);
1320 1320
1321 SkAutoTUnref<GrXferProcessor> xp(xpf->createXferProcessor(colorPOI, covPOI, 0, caps)); 1321 SkAutoTUnref<GrXferProcessor> xp(xpf->createXferProcessor(colorPOI, covPOI, 0, caps));
1322 if (!xp) { 1322 if (!xp) {
1323 ERRORF(reporter, "Failed to create an XP with LCD coverage."); 1323 ERRORF(reporter, "Failed to create an XP with LCD coverage.");
1324 return; 1324 return;
1325 } 1325 }
1326 1326
1327 GrColor overrideColor; 1327 GrColor overrideColor;
1328 xp->getOptimizations(colorPOI, covPOI, false, &overrideColor, caps); 1328 xp->getOptimizations(colorPOI, covPOI, false, &overrideColor, caps);
1329 1329
1330 GrXferProcessor::BlendInfo blendInfo; 1330 GrXferProcessor::BlendInfo blendInfo;
1331 xp->getBlendInfo(&blendInfo); 1331 xp->getBlendInfo(&blendInfo);
1332 TEST_ASSERT(blendInfo.fWriteColor); 1332 TEST_ASSERT(blendInfo.fWriteColor);
1333 } 1333 }
1334 1334
1335 #endif 1335 #endif
1336 1336
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698