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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 fGpu = GrGpu::Create(backend, backendContext, this); | 120 fGpu = GrGpu::Create(backend, backendContext, this); |
121 if (NULL == fGpu) { | 121 if (NULL == fGpu) { |
122 return false; | 122 return false; |
123 } | 123 } |
124 this->initCommon(); | 124 this->initCommon(); |
125 return true; | 125 return true; |
126 } | 126 } |
127 | 127 |
128 void GrContext::initCommon() { | 128 void GrContext::initCommon() { |
129 fDrawState = SkNEW(GrDrawState); | 129 fDrawState = SkNEW(GrDrawState); |
130 fGpu->setDrawState(fDrawState); | |
131 | 130 |
132 fResourceCache = SkNEW_ARGS(GrResourceCache, (fGpu->caps(), | 131 fResourceCache = SkNEW_ARGS(GrResourceCache, (fGpu->caps(), |
133 MAX_RESOURCE_CACHE_COUNT, | 132 MAX_RESOURCE_CACHE_COUNT, |
134 MAX_RESOURCE_CACHE_BYTES)); | 133 MAX_RESOURCE_CACHE_BYTES)); |
135 fResourceCache->setOverbudgetCallback(OverbudgetCB, this); | 134 fResourceCache->setOverbudgetCallback(OverbudgetCB, this); |
136 fResourceCache2 = SkNEW(GrResourceCache2); | 135 fResourceCache2 = SkNEW(GrResourceCache2); |
137 | 136 |
138 fFontCache = SkNEW_ARGS(GrFontCache, (fGpu)); | 137 fFontCache = SkNEW_ARGS(GrFontCache, (fGpu)); |
139 | 138 |
140 fLayerCache.reset(SkNEW_ARGS(GrLayerCache, (this))); | 139 fLayerCache.reset(SkNEW_ARGS(GrLayerCache, (this))); |
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1780 fResourceCache->printStats(); | 1779 fResourceCache->printStats(); |
1781 } | 1780 } |
1782 #endif | 1781 #endif |
1783 | 1782 |
1784 #if GR_GPU_STATS | 1783 #if GR_GPU_STATS |
1785 const GrContext::GPUStats* GrContext::gpuStats() const { | 1784 const GrContext::GPUStats* GrContext::gpuStats() const { |
1786 return fGpu->gpuStats(); | 1785 return fGpu->gpuStats(); |
1787 } | 1786 } |
1788 #endif | 1787 #endif |
1789 | 1788 |
OLD | NEW |