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 | 9 |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1746 fLastDrawWasBuffered = kNo_BufferedDraw; | 1746 fLastDrawWasBuffered = kNo_BufferedDraw; |
1747 } | 1747 } |
1748 ASSERT_OWNED_RESOURCE(fRenderTarget.get()); | 1748 ASSERT_OWNED_RESOURCE(fRenderTarget.get()); |
1749 if (NULL != paint) { | 1749 if (NULL != paint) { |
1750 SkASSERT(NULL != are); | 1750 SkASSERT(NULL != are); |
1751 SkASSERT(NULL != acf); | 1751 SkASSERT(NULL != acf); |
1752 are->set(fDrawState); | 1752 are->set(fDrawState); |
1753 fDrawState->setFromPaint(*paint, fViewMatrix, fRenderTarget.get()); | 1753 fDrawState->setFromPaint(*paint, fViewMatrix, fRenderTarget.get()); |
1754 #if GR_DEBUG_PARTIAL_COVERAGE_CHECK | 1754 #if GR_DEBUG_PARTIAL_COVERAGE_CHECK |
1755 if ((paint->hasMask() || 0xff != paint->fCoverage) && | 1755 if ((paint->hasMask() || 0xff != paint->fCoverage) && |
1756 !fGpu->canApplyCoverage()) { | 1756 !fDrawState->couldApplyCoverage(fGpu->caps())) { |
1757 GrPrintf("Partial pixel coverage will be incorrectly blended.\n"); | 1757 GrPrintf("Partial pixel coverage will be incorrectly blended.\n"); |
1758 } | 1758 } |
1759 #endif | 1759 #endif |
1760 if (fDrawState->getBlendOpts() & GrDrawState::kSkipDraw_BlendOptFlag) { | 1760 if (fDrawState->getBlendOpts() & GrDrawState::kSkipDraw_BlendOptFlag) { |
1761 are->set(NULL); | 1761 are->set(NULL); |
1762 return NULL; | 1762 return NULL; |
1763 } | 1763 } |
1764 } else { | 1764 } else { |
1765 fDrawState->reset(fViewMatrix); | 1765 fDrawState->reset(fViewMatrix); |
1766 fDrawState->setRenderTarget(fRenderTarget.get()); | 1766 fDrawState->setRenderTarget(fRenderTarget.get()); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1947 fDrawBuffer->removeGpuTraceMarker(marker); | 1947 fDrawBuffer->removeGpuTraceMarker(marker); |
1948 } | 1948 } |
1949 } | 1949 } |
1950 | 1950 |
1951 /////////////////////////////////////////////////////////////////////////////// | 1951 /////////////////////////////////////////////////////////////////////////////// |
1952 #if GR_CACHE_STATS | 1952 #if GR_CACHE_STATS |
1953 void GrContext::printCacheStats() const { | 1953 void GrContext::printCacheStats() const { |
1954 fResourceCache->printStats(); | 1954 fResourceCache->printStats(); |
1955 } | 1955 } |
1956 #endif | 1956 #endif |
OLD | NEW |