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

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

Issue 1439533003: Readd "immediate" mode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up Created 5 years, 1 month 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 | « src/gpu/GrCaps.cpp ('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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 bool GrContext::init(GrBackend backend, GrBackendContext backendContext, 67 bool GrContext::init(GrBackend backend, GrBackendContext backendContext,
68 const GrContextOptions& options) { 68 const GrContextOptions& options) {
69 SkASSERT(!fGpu); 69 SkASSERT(!fGpu);
70 70
71 fGpu = GrGpu::Create(backend, backendContext, options, this); 71 fGpu = GrGpu::Create(backend, backendContext, options, this);
72 if (!fGpu) { 72 if (!fGpu) {
73 return false; 73 return false;
74 } 74 }
75 this->initCommon(options); 75 this->initCommon();
76 return true; 76 return true;
77 } 77 }
78 78
79 void GrContext::initCommon(const GrContextOptions& options) { 79 void GrContext::initCommon() {
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 fDrawingManager.reset(new GrDrawingManager(this)); 89 fDrawingManager.reset(new GrDrawingManager(this));
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 618
619 void GrContext::setResourceCacheLimits(int maxTextures, size_t maxTextureBytes) { 619 void GrContext::setResourceCacheLimits(int maxTextures, size_t maxTextureBytes) {
620 fResourceCache->setLimits(maxTextures, maxTextureBytes); 620 fResourceCache->setLimits(maxTextures, maxTextureBytes);
621 } 621 }
622 622
623 ////////////////////////////////////////////////////////////////////////////// 623 //////////////////////////////////////////////////////////////////////////////
624 624
625 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { 625 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
626 fResourceCache->dumpMemoryStatistics(traceMemoryDump); 626 fResourceCache->dumpMemoryStatistics(traceMemoryDump);
627 } 627 }
OLDNEW
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698