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 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1684 } | 1684 } |
1685 | 1685 |
1686 return pr; | 1686 return pr; |
1687 } | 1687 } |
1688 | 1688 |
1689 //////////////////////////////////////////////////////////////////////////////// | 1689 //////////////////////////////////////////////////////////////////////////////// |
1690 bool GrContext::isConfigRenderable(GrPixelConfig config, bool withMSAA) const { | 1690 bool GrContext::isConfigRenderable(GrPixelConfig config, bool withMSAA) const { |
1691 return fGpu->caps()->isConfigRenderable(config, withMSAA); | 1691 return fGpu->caps()->isConfigRenderable(config, withMSAA); |
1692 } | 1692 } |
1693 | 1693 |
1694 static inline intptr_t setOrClear(intptr_t bits, int shift, intptr_t pred) { | |
1695 intptr_t mask = 1 << shift; | |
1696 if (pred) { | |
1697 bits |= mask; | |
1698 } else { | |
1699 bits &= ~mask; | |
1700 } | |
1701 return bits; | |
1702 } | |
1703 | |
1704 void GrContext::setupDrawBuffer() { | 1694 void GrContext::setupDrawBuffer() { |
1705 SkASSERT(NULL == fDrawBuffer); | 1695 SkASSERT(NULL == fDrawBuffer); |
1706 SkASSERT(NULL == fDrawBufferVBAllocPool); | 1696 SkASSERT(NULL == fDrawBufferVBAllocPool); |
1707 SkASSERT(NULL == fDrawBufferIBAllocPool); | 1697 SkASSERT(NULL == fDrawBufferIBAllocPool); |
1708 | 1698 |
1709 fDrawBufferVBAllocPool = | 1699 fDrawBufferVBAllocPool = |
1710 SkNEW_ARGS(GrVertexBufferAllocPool, (fGpu, false, | 1700 SkNEW_ARGS(GrVertexBufferAllocPool, (fGpu, false, |
1711 DRAW_BUFFER_VBPOOL_BUFFER_SIZE, | 1701 DRAW_BUFFER_VBPOOL_BUFFER_SIZE, |
1712 DRAW_BUFFER_VBPOOL_PREALLOC_BUFFERS)); | 1702 DRAW_BUFFER_VBPOOL_PREALLOC_BUFFERS)); |
1713 fDrawBufferIBAllocPool = | 1703 fDrawBufferIBAllocPool = |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 return NULL; | 1761 return NULL; |
1772 } | 1762 } |
1773 } | 1763 } |
1774 | 1764 |
1775 /////////////////////////////////////////////////////////////////////////////// | 1765 /////////////////////////////////////////////////////////////////////////////// |
1776 #if GR_CACHE_STATS | 1766 #if GR_CACHE_STATS |
1777 void GrContext::printCacheStats() const { | 1767 void GrContext::printCacheStats() const { |
1778 fTextureCache->printStats(); | 1768 fTextureCache->printStats(); |
1779 } | 1769 } |
1780 #endif | 1770 #endif |
OLD | NEW |