| 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 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1731 return true; | 1731 return true; |
| 1732 } | 1732 } |
| 1733 //////////////////////////////////////////////////////////////////////////////// | 1733 //////////////////////////////////////////////////////////////////////////////// |
| 1734 | 1734 |
| 1735 GrDrawTarget* GrContext::prepareToDraw(const GrPaint* paint, | 1735 GrDrawTarget* GrContext::prepareToDraw(const GrPaint* paint, |
| 1736 BufferedDraw buffered, | 1736 BufferedDraw buffered, |
| 1737 AutoRestoreEffects* are, | 1737 AutoRestoreEffects* are, |
| 1738 AutoCheckFlush* acf) { | 1738 AutoCheckFlush* acf) { |
| 1739 // All users of this draw state should be freeing up all effects when they'r
e done. | 1739 // All users of this draw state should be freeing up all effects when they'r
e done. |
| 1740 // Otherwise effects that own resources may keep those resources alive indef
initely. | 1740 // Otherwise effects that own resources may keep those resources alive indef
initely. |
| 1741 SkASSERT(0 == fDrawState->numColorStages() && 0 == fDrawState->numCoverageSt
ages()); | 1741 SkASSERT(0 == fDrawState->numColorStages() && 0 == fDrawState->numCoverageSt
ages() && |
| 1742 !fDrawState->hasGeometryProcessor()); |
| 1742 | 1743 |
| 1743 if (NULL == fGpu) { | 1744 if (NULL == fGpu) { |
| 1744 return NULL; | 1745 return NULL; |
| 1745 } | 1746 } |
| 1746 | 1747 |
| 1747 if (kNo_BufferedDraw == buffered && kYes_BufferedDraw == fLastDrawWasBuffere
d) { | 1748 if (kNo_BufferedDraw == buffered && kYes_BufferedDraw == fLastDrawWasBuffere
d) { |
| 1748 fDrawBuffer->flush(); | 1749 fDrawBuffer->flush(); |
| 1749 fLastDrawWasBuffered = kNo_BufferedDraw; | 1750 fLastDrawWasBuffered = kNo_BufferedDraw; |
| 1750 } | 1751 } |
| 1751 ASSERT_OWNED_RESOURCE(fRenderTarget.get()); | 1752 ASSERT_OWNED_RESOURCE(fRenderTarget.get()); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1949 fDrawBuffer->removeGpuTraceMarker(marker); | 1950 fDrawBuffer->removeGpuTraceMarker(marker); |
| 1950 } | 1951 } |
| 1951 } | 1952 } |
| 1952 | 1953 |
| 1953 /////////////////////////////////////////////////////////////////////////////// | 1954 /////////////////////////////////////////////////////////////////////////////// |
| 1954 #if GR_CACHE_STATS | 1955 #if GR_CACHE_STATS |
| 1955 void GrContext::printCacheStats() const { | 1956 void GrContext::printCacheStats() const { |
| 1956 fResourceCache->printStats(); | 1957 fResourceCache->printStats(); |
| 1957 } | 1958 } |
| 1958 #endif | 1959 #endif |
| OLD | NEW |