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 |
11 #include "GrAARectRenderer.h" | 11 #include "GrAARectRenderer.h" |
12 #include "GrAtlasTextContext.h" | 12 #include "GrAtlasTextContext.h" |
13 #include "GrBatch.h" | 13 #include "GrBatch.h" |
14 #include "GrBatchFontCache.h" | 14 #include "GrBatchFontCache.h" |
15 #include "GrBatchTarget.h" | 15 #include "GrBatchTarget.h" |
16 #include "GrBatchTest.h" | 16 #include "GrBatchTest.h" |
17 #include "GrDefaultGeoProcFactory.h" | 17 #include "GrDefaultGeoProcFactory.h" |
18 #include "GrGpuResource.h" | 18 #include "GrGpuResource.h" |
19 #include "GrGpuResourcePriv.h" | 19 #include "GrGpuResourcePriv.h" |
20 #include "GrDrawTargetCaps.h" | 20 #include "GrDrawTargetCaps.h" |
21 #include "GrGpu.h" | 21 #include "GrGpu.h" |
| 22 #include "GrImmediateDrawTarget.h" |
22 #include "GrIndexBuffer.h" | 23 #include "GrIndexBuffer.h" |
23 #include "GrInOrderDrawBuffer.h" | 24 #include "GrInOrderDrawBuffer.h" |
24 #include "GrLayerCache.h" | 25 #include "GrLayerCache.h" |
25 #include "GrOvalRenderer.h" | 26 #include "GrOvalRenderer.h" |
26 #include "GrPathRenderer.h" | 27 #include "GrPathRenderer.h" |
27 #include "GrPathUtils.h" | 28 #include "GrPathUtils.h" |
28 #include "GrRenderTargetPriv.h" | 29 #include "GrRenderTargetPriv.h" |
29 #include "GrResourceCache.h" | 30 #include "GrResourceCache.h" |
30 #include "GrResourceProvider.h" | 31 #include "GrResourceProvider.h" |
31 #include "GrSoftwarePathRenderer.h" | 32 #include "GrSoftwarePathRenderer.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 fResourceCache->setOverBudgetCallback(OverBudgetCB, this); | 126 fResourceCache->setOverBudgetCallback(OverBudgetCB, this); |
126 fResourceProvider = SkNEW_ARGS(GrResourceProvider, (fGpu, fResourceCache)); | 127 fResourceProvider = SkNEW_ARGS(GrResourceProvider, (fGpu, fResourceCache)); |
127 | 128 |
128 fLayerCache.reset(SkNEW_ARGS(GrLayerCache, (this))); | 129 fLayerCache.reset(SkNEW_ARGS(GrLayerCache, (this))); |
129 | 130 |
130 fAARectRenderer = SkNEW(GrAARectRenderer); | 131 fAARectRenderer = SkNEW(GrAARectRenderer); |
131 fOvalRenderer = SkNEW(GrOvalRenderer); | 132 fOvalRenderer = SkNEW(GrOvalRenderer); |
132 | 133 |
133 fDidTestPMConversions = false; | 134 fDidTestPMConversions = false; |
134 | 135 |
| 136 #ifdef IMMEDIATE_MODE |
| 137 fDrawBuffer = SkNEW_ARGS(GrImmediateDrawTarget, (this)); |
| 138 #else |
135 fDrawBuffer = SkNEW_ARGS(GrInOrderDrawBuffer, (this)); | 139 fDrawBuffer = SkNEW_ARGS(GrInOrderDrawBuffer, (this)); |
| 140 #endif |
136 | 141 |
137 // GrBatchFontCache will eventually replace GrFontCache | 142 // GrBatchFontCache will eventually replace GrFontCache |
138 fBatchFontCache = SkNEW_ARGS(GrBatchFontCache, (this)); | 143 fBatchFontCache = SkNEW_ARGS(GrBatchFontCache, (this)); |
139 | 144 |
140 fTextBlobCache.reset(SkNEW_ARGS(GrTextBlobCache, (TextBlobCacheOverBudgetCB,
this))); | 145 fTextBlobCache.reset(SkNEW_ARGS(GrTextBlobCache, (TextBlobCacheOverBudgetCB,
this))); |
141 } | 146 } |
142 | 147 |
143 GrContext::~GrContext() { | 148 GrContext::~GrContext() { |
144 if (NULL == fGpu) { | 149 if (NULL == fGpu) { |
145 return; | 150 return; |
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2000 geometry.fColor = GrRandomColor(random); | 2005 geometry.fColor = GrRandomColor(random); |
2001 return DrawVerticesBatch::Create(geometry, type, viewMatrix, | 2006 return DrawVerticesBatch::Create(geometry, type, viewMatrix, |
2002 positions.begin(), vertexCount, | 2007 positions.begin(), vertexCount, |
2003 indices.begin(), hasIndices ? vertexCount :
0, | 2008 indices.begin(), hasIndices ? vertexCount :
0, |
2004 colors.begin(), | 2009 colors.begin(), |
2005 texCoords.begin(), | 2010 texCoords.begin(), |
2006 bounds); | 2011 bounds); |
2007 } | 2012 } |
2008 | 2013 |
2009 #endif | 2014 #endif |
OLD | NEW |