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 #include "GrContext.h" | 9 #include "GrContext.h" |
10 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 void GrContext::initCommon(const GrContextOptions& options) { | 79 void GrContext::initCommon(const GrContextOptions& options) { |
80 fCaps = SkRef(fGpu->caps()); | 80 fCaps = SkRef(fGpu->caps()); |
81 fResourceCache = new GrResourceCache(fCaps); | 81 fResourceCache = new GrResourceCache(fCaps); |
82 fResourceCache->setOverBudgetCallback(OverBudgetCB, this); | 82 fResourceCache->setOverBudgetCallback(OverBudgetCB, this); |
83 fResourceProvider = new GrResourceProvider(fGpu, fResourceCache); | 83 fResourceProvider = new GrResourceProvider(fGpu, fResourceCache); |
84 | 84 |
85 fLayerCache.reset(new GrLayerCache(this)); | 85 fLayerCache.reset(new GrLayerCache(this)); |
86 | 86 |
87 fDidTestPMConversions = false; | 87 fDidTestPMConversions = false; |
88 | 88 |
89 GrDrawTarget::Options dtOptions; | 89 fDrawingManager.reset(new GrDrawingManager(this)); |
90 dtOptions.fImmediateMode = options.fImmediateMode; | |
91 fDrawingManager.reset(new GrDrawingManager(this, dtOptions)); | |
92 | 90 |
93 // GrBatchFontCache will eventually replace GrFontCache | 91 // GrBatchFontCache will eventually replace GrFontCache |
94 fBatchFontCache = new GrBatchFontCache(this); | 92 fBatchFontCache = new GrBatchFontCache(this); |
95 | 93 |
96 fTextBlobCache.reset(new GrTextBlobCache(TextBlobCacheOverBudgetCB, this)); | 94 fTextBlobCache.reset(new GrTextBlobCache(TextBlobCacheOverBudgetCB, this)); |
97 } | 95 } |
98 | 96 |
99 GrContext::~GrContext() { | 97 GrContext::~GrContext() { |
100 if (!fGpu) { | 98 if (!fGpu) { |
101 SkASSERT(!fCaps); | 99 SkASSERT(!fCaps); |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 | 618 |
621 void GrContext::setResourceCacheLimits(int maxTextures, size_t maxTextureBytes)
{ | 619 void GrContext::setResourceCacheLimits(int maxTextures, size_t maxTextureBytes)
{ |
622 fResourceCache->setLimits(maxTextures, maxTextureBytes); | 620 fResourceCache->setLimits(maxTextures, maxTextureBytes); |
623 } | 621 } |
624 | 622 |
625 ////////////////////////////////////////////////////////////////////////////// | 623 ////////////////////////////////////////////////////////////////////////////// |
626 | 624 |
627 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { | 625 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { |
628 fResourceCache->dumpMemoryStatistics(traceMemoryDump); | 626 fResourceCache->dumpMemoryStatistics(traceMemoryDump); |
629 } | 627 } |
OLD | NEW |