OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrContext.h" | 9 #include "GrContext.h" |
10 | 10 |
(...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1562 | 1562 |
1563 GrDrawTarget* GrContext::prepareToDraw(GrDrawState* ds, | 1563 GrDrawTarget* GrContext::prepareToDraw(GrDrawState* ds, |
1564 const GrPaint* paint, | 1564 const GrPaint* paint, |
1565 const AutoCheckFlush* acf) { | 1565 const AutoCheckFlush* acf) { |
1566 if (NULL == fGpu) { | 1566 if (NULL == fGpu) { |
1567 return NULL; | 1567 return NULL; |
1568 } | 1568 } |
1569 | 1569 |
1570 ASSERT_OWNED_RESOURCE(fRenderTarget.get()); | 1570 ASSERT_OWNED_RESOURCE(fRenderTarget.get()); |
1571 if (ds) { | 1571 if (ds) { |
1572 if (paint) { | 1572 SkASSERT(paint && acf); |
egdaniel
2015/01/21 22:31:36
Do we want to support the case where we have a Dra
bsalomon
2015/01/21 23:03:06
If it's not being used, then let's just update the
| |
1573 SkASSERT(acf); | 1573 ds->setFromPaint(*paint, fRenderTarget.get()); |
1574 ds->setFromPaint(*paint, fRenderTarget.get()); | |
1575 #if GR_DEBUG_PARTIAL_COVERAGE_CHECK | 1574 #if GR_DEBUG_PARTIAL_COVERAGE_CHECK |
egdaniel
2015/01/21 22:31:36
what is this debug check for? is it still useful t
bsalomon
2015/01/21 23:03:06
Since we're on the path to deleting canUFCPP, ok t
| |
1576 if ((paint->hasMask()) && | 1575 if ((paint->hasMask()) && |
1577 !fDrawState->canUseFracCoveragePrimProc(paint.getColor(), fGpu-> caps())) { | 1576 !fDrawState->canUseFracCoveragePrimProc(paint.getColor(), fGpu->caps ())) { |
1578 SkDebugf("Partial pixel coverage will be incorrectly blended.\n" ); | 1577 SkDebugf("Partial pixel coverage will be incorrectly blended.\n"); |
1579 } | 1578 } |
1580 #endif | 1579 #endif |
1581 } else { | |
1582 ds->reset(); | |
1583 ds->setRenderTarget(fRenderTarget.get()); | |
1584 } | |
1585 ds->setState(GrDrawState::kClip_StateBit, fClip && !fClip->fClipStack->i sWideOpen()); | 1580 ds->setState(GrDrawState::kClip_StateBit, fClip && !fClip->fClipStack->i sWideOpen()); |
1586 } | 1581 } |
1587 fDrawBuffer->setClip(fClip); | 1582 fDrawBuffer->setClip(fClip); |
1588 return fDrawBuffer; | 1583 return fDrawBuffer; |
1589 } | 1584 } |
1590 | 1585 |
1591 /* | 1586 /* |
1592 * This method finds a path renderer that can draw the specified path on | 1587 * This method finds a path renderer that can draw the specified path on |
1593 * the provided target. | 1588 * the provided target. |
1594 * Due to its expense, the software path renderer has split out so it can | 1589 * Due to its expense, the software path renderer has split out so it can |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1744 fResourceCache2->printStats(); | 1739 fResourceCache2->printStats(); |
1745 } | 1740 } |
1746 #endif | 1741 #endif |
1747 | 1742 |
1748 #if GR_GPU_STATS | 1743 #if GR_GPU_STATS |
1749 const GrContext::GPUStats* GrContext::gpuStats() const { | 1744 const GrContext::GPUStats* GrContext::gpuStats() const { |
1750 return fGpu->gpuStats(); | 1745 return fGpu->gpuStats(); |
1751 } | 1746 } |
1752 #endif | 1747 #endif |
1753 | 1748 |
OLD | NEW |