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

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

Issue 1854283004: Track GL buffer state based on unique resource ID (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/GrBufferAllocPool.cpp ('k') | src/gpu/GrGpu.h » ('j') | src/gpu/gl/GrGLGpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698