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 | 10 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 fGpu = GrGpu::Create(backend, backendContext, options, this); | 175 fGpu = GrGpu::Create(backend, backendContext, options, this); |
176 if (!fGpu) { | 176 if (!fGpu) { |
177 return false; | 177 return false; |
178 } | 178 } |
179 this->initCommon(); | 179 this->initCommon(); |
180 return true; | 180 return true; |
181 } | 181 } |
182 | 182 |
183 void GrContext::initCommon() { | 183 void GrContext::initCommon() { |
184 fCaps = SkRef(fGpu->caps()); | 184 fCaps = SkRef(fGpu->caps()); |
185 fResourceCache = SkNEW(GrResourceCache); | 185 fResourceCache = SkNEW_ARGS(GrResourceCache, (fCaps)); |
186 fResourceCache->setOverBudgetCallback(OverBudgetCB, this); | 186 fResourceCache->setOverBudgetCallback(OverBudgetCB, this); |
187 fResourceProvider = SkNEW_ARGS(GrResourceProvider, (fGpu, fResourceCache)); | 187 fResourceProvider = SkNEW_ARGS(GrResourceProvider, (fGpu, fResourceCache)); |
188 | 188 |
189 fLayerCache.reset(SkNEW_ARGS(GrLayerCache, (this))); | 189 fLayerCache.reset(SkNEW_ARGS(GrLayerCache, (this))); |
190 | 190 |
191 fDidTestPMConversions = false; | 191 fDidTestPMConversions = false; |
192 | 192 |
193 fDrawingMgr.init(this); | 193 fDrawingMgr.init(this); |
194 | 194 |
195 // GrBatchFontCache will eventually replace GrFontCache | 195 // GrBatchFontCache will eventually replace GrFontCache |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 ////////////////////////////////////////////////////////////////////////////// | 754 ////////////////////////////////////////////////////////////////////////////// |
755 | 755 |
756 void GrContext::addGpuTraceMarker(const GrGpuTraceMarker* marker) { | 756 void GrContext::addGpuTraceMarker(const GrGpuTraceMarker* marker) { |
757 fGpu->addGpuTraceMarker(marker); | 757 fGpu->addGpuTraceMarker(marker); |
758 } | 758 } |
759 | 759 |
760 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { | 760 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { |
761 fGpu->removeGpuTraceMarker(marker); | 761 fGpu->removeGpuTraceMarker(marker); |
762 } | 762 } |
763 | 763 |
OLD | NEW |