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

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

Issue 656503002: Move willUseInputColor check to computeInvariantOutput (Closed) Base URL: https://skia.googlesource.com/skia.git@addMultFlag
Patch Set: Rebase2 Created 6 years, 2 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/GrProcessor.cpp ('k') | src/gpu/effects/GrDitherEffect.cpp » ('j') | 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 2014 Google Inc. 2 * Copyright 2014 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 "gl/builders/GrGLProgramBuilder.h" 8 #include "gl/builders/GrGLProgramBuilder.h"
9 #include "GrConvexPolyEffect.h" 9 #include "GrConvexPolyEffect.h"
10 10
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 virtual bool onIsEqual(const GrFragmentProcessor& other) const SK_OVERRIDE { 41 virtual bool onIsEqual(const GrFragmentProcessor& other) const SK_OVERRIDE {
42 const AARectEffect& aare = other.cast<AARectEffect>(); 42 const AARectEffect& aare = other.cast<AARectEffect>();
43 return fRect == aare.fRect; 43 return fRect == aare.fRect;
44 } 44 }
45 45
46 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE { 46 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE {
47 if (fRect.isEmpty()) { 47 if (fRect.isEmpty()) {
48 // An empty rect will have no coverage anywhere. 48 // An empty rect will have no coverage anywhere.
49 inout->setToTransparentBlack(); 49 inout->mulByKnownAlpha(0);
50 } else { 50 } else {
51 inout->mulByUnknownAlpha(); 51 inout->mulByUnknownAlpha();
52 } 52 }
53 } 53 }
54 54
55 SkRect fRect; 55 SkRect fRect;
56 GrPrimitiveEdgeType fEdgeType; 56 GrPrimitiveEdgeType fEdgeType;
57 57
58 typedef GrFragmentProcessor INHERITED; 58 typedef GrFragmentProcessor INHERITED;
59 59
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 } 370 }
371 371
372 GrFragmentProcessor* fp; 372 GrFragmentProcessor* fp;
373 do { 373 do {
374 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( 374 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
375 random->nextULessThan(kGrProcessorEdgeTy peCnt)); 375 random->nextULessThan(kGrProcessorEdgeTy peCnt));
376 fp = GrConvexPolyEffect::Create(edgeType, count, edges); 376 fp = GrConvexPolyEffect::Create(edgeType, count, edges);
377 } while (NULL == fp); 377 } while (NULL == fp);
378 return fp; 378 return fp;
379 } 379 }
OLDNEW
« no previous file with comments | « src/gpu/GrProcessor.cpp ('k') | src/gpu/effects/GrDitherEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698