| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrContext.h" | 8 #include "GrContext.h" |
| 9 #include "GrContextOptions.h" | 9 #include "GrContextOptions.h" |
| 10 #include "GrDrawingManager.h" | 10 #include "GrDrawingManager.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 } | 80 } |
| 81 | 81 |
| 82 void GrContext::initCommon(const GrContextOptions& options) { | 82 void GrContext::initCommon(const GrContextOptions& options) { |
| 83 ASSERT_SINGLE_OWNER | 83 ASSERT_SINGLE_OWNER |
| 84 | 84 |
| 85 fCaps = SkRef(fGpu->caps()); | 85 fCaps = SkRef(fGpu->caps()); |
| 86 fResourceCache = new GrResourceCache(fCaps); | 86 fResourceCache = new GrResourceCache(fCaps); |
| 87 fResourceCache->setOverBudgetCallback(OverBudgetCB, this); | 87 fResourceCache->setOverBudgetCallback(OverBudgetCB, this); |
| 88 fResourceProvider = new GrResourceProvider(fGpu, fResourceCache, &fSingleOwn
er); | 88 fResourceProvider = new GrResourceProvider(fGpu, fResourceCache, &fSingleOwn
er); |
| 89 | 89 |
| 90 // Must be called after the resource cache is initialized. |
| 91 fGpu->initGpuResources(); |
| 92 |
| 90 fLayerCache.reset(new GrLayerCache(this)); | 93 fLayerCache.reset(new GrLayerCache(this)); |
| 91 | 94 |
| 92 fDidTestPMConversions = false; | 95 fDidTestPMConversions = false; |
| 93 | 96 |
| 94 GrDrawTarget::Options dtOptions; | 97 GrDrawTarget::Options dtOptions; |
| 95 dtOptions.fClipBatchToBounds = options.fClipBatchToBounds; | 98 dtOptions.fClipBatchToBounds = options.fClipBatchToBounds; |
| 96 dtOptions.fDrawBatchBounds = options.fDrawBatchBounds; | 99 dtOptions.fDrawBatchBounds = options.fDrawBatchBounds; |
| 97 dtOptions.fMaxBatchLookback = options.fMaxBatchLookback; | 100 dtOptions.fMaxBatchLookback = options.fMaxBatchLookback; |
| 98 dtOptions.fMaxBatchLookahead = options.fMaxBatchLookahead; | 101 dtOptions.fMaxBatchLookahead = options.fMaxBatchLookahead; |
| 99 fDrawingManager.reset(new GrDrawingManager(this, dtOptions, &fSingleOwner)); | 102 fDrawingManager.reset(new GrDrawingManager(this, dtOptions, &fSingleOwner)); |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 ASSERT_SINGLE_OWNER | 692 ASSERT_SINGLE_OWNER |
| 690 fResourceCache->setLimits(maxTextures, maxTextureBytes); | 693 fResourceCache->setLimits(maxTextures, maxTextureBytes); |
| 691 } | 694 } |
| 692 | 695 |
| 693 ////////////////////////////////////////////////////////////////////////////// | 696 ////////////////////////////////////////////////////////////////////////////// |
| 694 | 697 |
| 695 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { | 698 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { |
| 696 ASSERT_SINGLE_OWNER | 699 ASSERT_SINGLE_OWNER |
| 697 fResourceCache->dumpMemoryStatistics(traceMemoryDump); | 700 fResourceCache->dumpMemoryStatistics(traceMemoryDump); |
| 698 } | 701 } |
| OLD | NEW |