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

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

Issue 1315513008: Cleanup GrDrawTarget now that all paths lead to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@patharray
Patch Set: remove change to SampleApp.cpp Created 5 years, 3 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
« no previous file with comments | « src/gpu/GrBufferedDrawTarget.cpp ('k') | src/gpu/GrDrawTarget.h » ('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 10
11 #include "GrBatchFontCache.h" 11 #include "GrBatchFontCache.h"
12 #include "GrBatchFlushState.h" 12 #include "GrBatchFlushState.h"
13 #include "GrBatchTest.h" 13 #include "GrBatchTest.h"
14 #include "GrBufferedDrawTarget.h"
15 #include "GrCaps.h" 14 #include "GrCaps.h"
16 #include "GrContextOptions.h" 15 #include "GrContextOptions.h"
17 #include "GrDefaultGeoProcFactory.h" 16 #include "GrDefaultGeoProcFactory.h"
18 #include "GrDrawContext.h" 17 #include "GrDrawContext.h"
18 #include "GrDrawTarget.h"
19 #include "GrGpuResource.h" 19 #include "GrGpuResource.h"
20 #include "GrGpuResourcePriv.h" 20 #include "GrGpuResourcePriv.h"
21 #include "GrGpu.h" 21 #include "GrGpu.h"
22 #include "GrImmediateDrawTarget.h"
23 #include "GrIndexBuffer.h" 22 #include "GrIndexBuffer.h"
24 #include "GrLayerCache.h" 23 #include "GrLayerCache.h"
25 #include "GrOvalRenderer.h" 24 #include "GrOvalRenderer.h"
26 #include "GrPathRenderer.h" 25 #include "GrPathRenderer.h"
27 #include "GrPathUtils.h" 26 #include "GrPathUtils.h"
28 #include "GrRenderTargetPriv.h" 27 #include "GrRenderTargetPriv.h"
29 #include "GrResourceCache.h" 28 #include "GrResourceCache.h"
30 #include "GrResourceProvider.h" 29 #include "GrResourceProvider.h"
31 #include "GrSoftwarePathRenderer.h" 30 #include "GrSoftwarePathRenderer.h"
32 #include "GrStrokeInfo.h" 31 #include "GrStrokeInfo.h"
(...skipping 21 matching lines...) Expand all
54 #define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == this) 53 #define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == this)
55 #define RETURN_IF_ABANDONED if (fDrawingMgr.abandoned()) { return; } 54 #define RETURN_IF_ABANDONED if (fDrawingMgr.abandoned()) { return; }
56 #define RETURN_FALSE_IF_ABANDONED if (fDrawingMgr.abandoned()) { return false; } 55 #define RETURN_FALSE_IF_ABANDONED if (fDrawingMgr.abandoned()) { return false; }
57 #define RETURN_NULL_IF_ABANDONED if (fDrawingMgr.abandoned()) { return nullptr; } 56 #define RETURN_NULL_IF_ABANDONED if (fDrawingMgr.abandoned()) { return nullptr; }
58 57
59 58
60 //////////////////////////////////////////////////////////////////////////////// 59 ////////////////////////////////////////////////////////////////////////////////
61 60
62 void GrContext::DrawingMgr::init(GrContext* context) { 61 void GrContext::DrawingMgr::init(GrContext* context) {
63 fContext = context; 62 fContext = context;
64 63 fDrawTarget = new GrClipTarget(context);
65 #ifdef IMMEDIATE_MODE
66 fDrawTarget = new GrImmediateDrawTarget(context);
67 #else
68 fDrawTarget = new GrBufferedDrawTarget(context);
69 #endif
70 } 64 }
71 65
72 void GrContext::DrawingMgr::cleanup() { 66 void GrContext::DrawingMgr::cleanup() {
73 SkSafeSetNull(fDrawTarget); 67 SkSafeSetNull(fDrawTarget);
74 for (int i = 0; i < kNumPixelGeometries; ++i) { 68 for (int i = 0; i < kNumPixelGeometries; ++i) {
75 SkSafeSetNull(fDrawContext[i][0]); 69 SkSafeSetNull(fDrawContext[i][0]);
76 SkSafeSetNull(fDrawContext[i][1]); 70 SkSafeSetNull(fDrawContext[i][1]);
77 } 71 }
78 } 72 }
79 73
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 } 738 }
745 if (maxTextureBytes) { 739 if (maxTextureBytes) {
746 *maxTextureBytes = fResourceCache->getMaxResourceBytes(); 740 *maxTextureBytes = fResourceCache->getMaxResourceBytes();
747 } 741 }
748 } 742 }
749 743
750 void GrContext::setResourceCacheLimits(int maxTextures, size_t maxTextureBytes) { 744 void GrContext::setResourceCacheLimits(int maxTextures, size_t maxTextureBytes) {
751 fResourceCache->setLimits(maxTextures, maxTextureBytes); 745 fResourceCache->setLimits(maxTextures, maxTextureBytes);
752 } 746 }
753 747
OLDNEW
« no previous file with comments | « src/gpu/GrBufferedDrawTarget.cpp ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698