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

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

Issue 1575093002: Reland of Add guards to GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@gpudeviceguards
Patch Set: Created 4 years, 11 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/GrTextureProvider.h ('k') | src/gpu/GrDrawContext.cpp » ('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 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrContextOptions.h" 10 #include "GrContextOptions.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 this->initCommon(options); 78 this->initCommon(options);
79 return true; 79 return true;
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); 88 fResourceProvider = new GrResourceProvider(fGpu, fResourceCache, &fSingleOwn er);
89 89
90 fLayerCache.reset(new GrLayerCache(this)); 90 fLayerCache.reset(new GrLayerCache(this));
91 91
92 fDidTestPMConversions = false; 92 fDidTestPMConversions = false;
93 93
94 GrDrawTarget::Options dtOptions; 94 GrDrawTarget::Options dtOptions;
95 dtOptions.fClipBatchToBounds = options.fClipBatchToBounds; 95 dtOptions.fClipBatchToBounds = options.fClipBatchToBounds;
96 dtOptions.fDrawBatchBounds = options.fDrawBatchBounds; 96 dtOptions.fDrawBatchBounds = options.fDrawBatchBounds;
97 dtOptions.fMaxBatchLookback = options.fMaxBatchLookback; 97 dtOptions.fMaxBatchLookback = options.fMaxBatchLookback;
98 fDrawingManager.reset(new GrDrawingManager(this, dtOptions, &fSingleOwner)); 98 fDrawingManager.reset(new GrDrawingManager(this, dtOptions, &fSingleOwner));
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 ASSERT_SINGLE_OWNER 658 ASSERT_SINGLE_OWNER
659 fResourceCache->setLimits(maxTextures, maxTextureBytes); 659 fResourceCache->setLimits(maxTextures, maxTextureBytes);
660 } 660 }
661 661
662 ////////////////////////////////////////////////////////////////////////////// 662 //////////////////////////////////////////////////////////////////////////////
663 663
664 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { 664 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
665 ASSERT_SINGLE_OWNER 665 ASSERT_SINGLE_OWNER
666 fResourceCache->dumpMemoryStatistics(traceMemoryDump); 666 fResourceCache->dumpMemoryStatistics(traceMemoryDump);
667 } 667 }
OLDNEW
« no previous file with comments | « include/gpu/GrTextureProvider.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698