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

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

Issue 196133014: Implement text rendering with NVPR (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix VS "performance warning" converting int to bool Created 6 years, 6 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/GrPaint.h ('k') | src/gpu/GrStencilAndCoverTextContext.h » ('j') | 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"
11 11
12 #include "effects/GrConfigConversionEffect.h" 12 #include "effects/GrConfigConversionEffect.h"
13 #include "effects/GrDashingEffect.h" 13 #include "effects/GrDashingEffect.h"
14 #include "effects/GrSingleTextureEffect.h" 14 #include "effects/GrSingleTextureEffect.h"
15 15
16 #include "GrAARectRenderer.h" 16 #include "GrAARectRenderer.h"
17 #include "GrBufferAllocPool.h" 17 #include "GrBufferAllocPool.h"
18 #include "GrGpu.h" 18 #include "GrGpu.h"
19 #include "GrDistanceFieldTextContext.h"
19 #include "GrDrawTargetCaps.h" 20 #include "GrDrawTargetCaps.h"
20 #include "GrIndexBuffer.h" 21 #include "GrIndexBuffer.h"
21 #include "GrInOrderDrawBuffer.h" 22 #include "GrInOrderDrawBuffer.h"
22 #include "GrLayerCache.h" 23 #include "GrLayerCache.h"
23 #include "GrOvalRenderer.h" 24 #include "GrOvalRenderer.h"
24 #include "GrPathRenderer.h" 25 #include "GrPathRenderer.h"
25 #include "GrPathUtils.h" 26 #include "GrPathUtils.h"
26 #include "GrResourceCache.h" 27 #include "GrResourceCache.h"
27 #include "GrSoftwarePathRenderer.h" 28 #include "GrSoftwarePathRenderer.h"
28 #include "GrStencilBuffer.h" 29 #include "GrStencilBuffer.h"
30 #include "GrStencilAndCoverTextContext.h"
29 #include "GrStrokeInfo.h" 31 #include "GrStrokeInfo.h"
30 #include "GrTextStrike.h" 32 #include "GrTextStrike.h"
31 #include "GrTraceMarker.h" 33 #include "GrTraceMarker.h"
32 #include "GrTracing.h" 34 #include "GrTracing.h"
33 #include "SkDashPathPriv.h" 35 #include "SkDashPathPriv.h"
34 #include "SkGr.h" 36 #include "SkGr.h"
35 #include "SkRTConf.h" 37 #include "SkRTConf.h"
36 #include "SkRRect.h" 38 #include "SkRRect.h"
37 #include "SkStrokeRec.h" 39 #include "SkStrokeRec.h"
38 #include "SkTLazy.h" 40 #include "SkTLazy.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 231
230 void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes) const { 232 void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes) const {
231 if (NULL != resourceCount) { 233 if (NULL != resourceCount) {
232 *resourceCount = fResourceCache->getCachedResourceCount(); 234 *resourceCount = fResourceCache->getCachedResourceCount();
233 } 235 }
234 if (NULL != resourceBytes) { 236 if (NULL != resourceBytes) {
235 *resourceBytes = fResourceCache->getCachedResourceBytes(); 237 *resourceBytes = fResourceCache->getCachedResourceBytes();
236 } 238 }
237 } 239 }
238 240
241 GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget,
242 const SkDeviceProperties&
243 leakyProperties,
244 bool enableDistanceFieldFonts) {
245 if (fGpu->caps()->pathRenderingSupport()) {
246 if (renderTarget->getStencilBuffer() && renderTarget->isMultisampled()) {
247 return SkNEW_ARGS(GrStencilAndCoverTextContext, (this, leakyProperti es));
248 }
249 }
250 return SkNEW_ARGS(GrDistanceFieldTextContext, (this, leakyProperties,
251 enableDistanceFieldFonts));
252 }
253
239 //////////////////////////////////////////////////////////////////////////////// 254 ////////////////////////////////////////////////////////////////////////////////
240 255
241 GrTexture* GrContext::findAndRefTexture(const GrTextureDesc& desc, 256 GrTexture* GrContext::findAndRefTexture(const GrTextureDesc& desc,
242 const GrCacheID& cacheID, 257 const GrCacheID& cacheID,
243 const GrTextureParams* params) { 258 const GrTextureParams* params) {
244 GrResourceKey resourceKey = GrTextureImpl::ComputeKey(fGpu, params, desc, ca cheID); 259 GrResourceKey resourceKey = GrTextureImpl::ComputeKey(fGpu, params, desc, ca cheID);
245 GrCacheable* resource = fResourceCache->find(resourceKey); 260 GrCacheable* resource = fResourceCache->find(resourceKey);
246 SkSafeRef(resource); 261 SkSafeRef(resource);
247 return static_cast<GrTexture*>(resource); 262 return static_cast<GrTexture*>(resource);
248 } 263 }
(...skipping 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after
1918 fDrawBuffer->removeGpuTraceMarker(marker); 1933 fDrawBuffer->removeGpuTraceMarker(marker);
1919 } 1934 }
1920 } 1935 }
1921 1936
1922 /////////////////////////////////////////////////////////////////////////////// 1937 ///////////////////////////////////////////////////////////////////////////////
1923 #if GR_CACHE_STATS 1938 #if GR_CACHE_STATS
1924 void GrContext::printCacheStats() const { 1939 void GrContext::printCacheStats() const {
1925 fResourceCache->printStats(); 1940 fResourceCache->printStats();
1926 } 1941 }
1927 #endif 1942 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrPaint.h ('k') | src/gpu/GrStencilAndCoverTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698