Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: src/gpu/GrContext.cpp

Issue 188403003: Add API for GrContext to recommend rendertarget sample count (Closed) Base URL: https://skia.googlesource.com/skia.git@skpathobject
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/GrContext.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 } 1696 }
1697 1697
1698 return pr; 1698 return pr;
1699 } 1699 }
1700 1700
1701 //////////////////////////////////////////////////////////////////////////////// 1701 ////////////////////////////////////////////////////////////////////////////////
1702 bool GrContext::isConfigRenderable(GrPixelConfig config, bool withMSAA) const { 1702 bool GrContext::isConfigRenderable(GrPixelConfig config, bool withMSAA) const {
1703 return fGpu->caps()->isConfigRenderable(config, withMSAA); 1703 return fGpu->caps()->isConfigRenderable(config, withMSAA);
1704 } 1704 }
1705 1705
1706 int GrContext::getRecommendedSampleCount(GrPixelConfig config, float) const {
1707 if (this->isConfigRenderable(config, true)) {
1708 if (fGpu->caps()->pathRenderingSupport()) {
1709 return 4;
bsalomon 2014/03/06 14:02:43 Should probably also check that 4 >= caps()->maxSa
1710 }
1711 }
1712 return 0;
1713 }
1714
1706 void GrContext::setupDrawBuffer() { 1715 void GrContext::setupDrawBuffer() {
1707 SkASSERT(NULL == fDrawBuffer); 1716 SkASSERT(NULL == fDrawBuffer);
1708 SkASSERT(NULL == fDrawBufferVBAllocPool); 1717 SkASSERT(NULL == fDrawBufferVBAllocPool);
1709 SkASSERT(NULL == fDrawBufferIBAllocPool); 1718 SkASSERT(NULL == fDrawBufferIBAllocPool);
1710 1719
1711 fDrawBufferVBAllocPool = 1720 fDrawBufferVBAllocPool =
1712 SkNEW_ARGS(GrVertexBufferAllocPool, (fGpu, false, 1721 SkNEW_ARGS(GrVertexBufferAllocPool, (fGpu, false,
1713 DRAW_BUFFER_VBPOOL_BUFFER_SIZE, 1722 DRAW_BUFFER_VBPOOL_BUFFER_SIZE,
1714 DRAW_BUFFER_VBPOOL_PREALLOC_BUFFERS)); 1723 DRAW_BUFFER_VBPOOL_PREALLOC_BUFFERS));
1715 fDrawBufferIBAllocPool = 1724 fDrawBufferIBAllocPool =
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1789 } 1798 }
1790 return path; 1799 return path;
1791 } 1800 }
1792 1801
1793 /////////////////////////////////////////////////////////////////////////////// 1802 ///////////////////////////////////////////////////////////////////////////////
1794 #if GR_CACHE_STATS 1803 #if GR_CACHE_STATS
1795 void GrContext::printCacheStats() const { 1804 void GrContext::printCacheStats() const {
1796 fTextureCache->printStats(); 1805 fTextureCache->printStats();
1797 } 1806 }
1798 #endif 1807 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698