OLD | NEW |
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 "GrDrawState.h" | 8 #include "GrDrawState.h" |
9 #include "GrPaint.h" | 9 #include "GrPaint.h" |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 for (int i = 0; i < paint.numCoverageStages(); ++i) { | 39 for (int i = 0; i < paint.numCoverageStages(); ++i) { |
40 fCoverageStages.push_back(paint.getCoverageStage(i)); | 40 fCoverageStages.push_back(paint.getCoverageStage(i)); |
41 } | 41 } |
42 | 42 |
43 this->setRenderTarget(rt); | 43 this->setRenderTarget(rt); |
44 | 44 |
45 fCommon.fViewMatrix = vm; | 45 fCommon.fViewMatrix = vm; |
46 | 46 |
47 // These have no equivalent in GrPaint, set them to defaults | 47 // These have no equivalent in GrPaint, set them to defaults |
48 fCommon.fBlendConstant = 0x0; | 48 fCommon.fBlendConstant = 0x0; |
49 fCommon.fCoverage = 0xffffffff; | |
50 fCommon.fDrawFace = kBoth_DrawFace; | 49 fCommon.fDrawFace = kBoth_DrawFace; |
51 fCommon.fStencilSettings.setDisabled(); | 50 fCommon.fStencilSettings.setDisabled(); |
52 this->resetStateFlags(); | 51 this->resetStateFlags(); |
53 | 52 |
54 // Enable the clip bit | 53 // Enable the clip bit |
55 this->enableState(GrDrawState::kClip_StateBit); | 54 this->enableState(GrDrawState::kClip_StateBit); |
56 | 55 |
57 this->setColor(paint.getColor()); | 56 this->setColor(paint.getColor()); |
| 57 this->setCoverage4(paint.getCoverage()); |
58 this->setState(GrDrawState::kDither_StateBit, paint.isDither()); | 58 this->setState(GrDrawState::kDither_StateBit, paint.isDither()); |
59 this->setState(GrDrawState::kHWAntialias_StateBit, paint.isAntiAlias()); | 59 this->setState(GrDrawState::kHWAntialias_StateBit, paint.isAntiAlias()); |
60 | 60 |
61 this->setBlendFunc(paint.getSrcBlendCoeff(), paint.getDstBlendCoeff()); | 61 this->setBlendFunc(paint.getSrcBlendCoeff(), paint.getDstBlendCoeff()); |
62 this->setColorFilter(paint.getColorFilterColor(), paint.getColorFilterMode()
); | 62 this->setColorFilter(paint.getColorFilterColor(), paint.getColorFilterMode()
); |
63 this->setCoverage(paint.getCoverage()); | 63 this->setCoverage(paint.getCoverage()); |
64 } | 64 } |
65 | 65 |
66 //////////////////////////////////////////////////////////////////////////////// | 66 //////////////////////////////////////////////////////////////////////////////// |
67 | 67 |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 fDrawState->fColorStages[s].saveCoordChange(&fSavedCoordChanges[i]); | 475 fDrawState->fColorStages[s].saveCoordChange(&fSavedCoordChanges[i]); |
476 fDrawState->fColorStages[s].localCoordChange(coordChangeMatrix); | 476 fDrawState->fColorStages[s].localCoordChange(coordChangeMatrix); |
477 } | 477 } |
478 | 478 |
479 int numCoverageStages = fDrawState->numCoverageStages(); | 479 int numCoverageStages = fDrawState->numCoverageStages(); |
480 for (int s = 0; s < numCoverageStages; ++s, ++i) { | 480 for (int s = 0; s < numCoverageStages; ++s, ++i) { |
481 fDrawState->fCoverageStages[s].saveCoordChange(&fSavedCoordChanges[i]); | 481 fDrawState->fCoverageStages[s].saveCoordChange(&fSavedCoordChanges[i]); |
482 fDrawState->fCoverageStages[s].localCoordChange(coordChangeMatrix); | 482 fDrawState->fCoverageStages[s].localCoordChange(coordChangeMatrix); |
483 } | 483 } |
484 } | 484 } |
OLD | NEW |