OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |