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

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

Issue 947443003: Move clip off of draw target (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc Created 5 years, 9 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/GrTest.h ('k') | src/gpu/GrTextContext.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 2013 Google Inc. 3 * Copyright 2013 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 "GrTest.h" 9 #include "GrTest.h"
10 10
11 #include "GrGpuResourceCacheAccess.h" 11 #include "GrGpuResourceCacheAccess.h"
12 #include "GrInOrderDrawBuffer.h" 12 #include "GrInOrderDrawBuffer.h"
13 #include "GrResourceCache.h" 13 #include "GrResourceCache.h"
14 #include "SkString.h" 14 #include "SkString.h"
15 15
16 void GrTestTarget::init(GrContext* ctx, GrDrawTarget* target) { 16 void GrTestTarget::init(GrContext* ctx, GrDrawTarget* target) {
17 SkASSERT(!fContext); 17 SkASSERT(!fContext);
18 18
19 fContext.reset(SkRef(ctx)); 19 fContext.reset(SkRef(ctx));
20 fDrawTarget.reset(SkRef(target)); 20 fDrawTarget.reset(SkRef(target));
21 21
22 SkNEW_IN_TLAZY(&fACR, GrDrawTarget::AutoClipRestore, (target));
23 SkNEW_IN_TLAZY(&fAGP, GrDrawTarget::AutoGeometryPush, (target)); 22 SkNEW_IN_TLAZY(&fAGP, GrDrawTarget::AutoGeometryPush, (target));
24 } 23 }
25 24
26 void GrContext::getTestTarget(GrTestTarget* tar) { 25 void GrContext::getTestTarget(GrTestTarget* tar) {
27 this->flush(); 26 this->flush();
28 // We could create a proxy GrDrawTarget that passes through to fGpu until ~G rTextTarget() and 27 // We could create a proxy GrDrawTarget that passes through to fGpu until ~G rTextTarget() and
29 // then disconnects. This would help prevent test writers from mixing using the returned 28 // then disconnects. This would help prevent test writers from mixing using the returned
30 // GrDrawTarget and regular drawing. We could also assert or fail in GrConte xt drawing methods 29 // GrDrawTarget and regular drawing. We could also assert or fail in GrConte xt drawing methods
31 // until ~GrTestTarget(). 30 // until ~GrTestTarget().
32 tar->init(this, fDrawBuffer); 31 tar->init(this, fDrawBuffer);
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 // these objects are required for any of tests that use this context. TODO: make stop allocating 266 // these objects are required for any of tests that use this context. TODO: make stop allocating
268 // resources in the buffer pools. 267 // resources in the buffer pools.
269 SkDELETE(fDrawBuffer); 268 SkDELETE(fDrawBuffer);
270 SkDELETE(fDrawBufferVBAllocPool); 269 SkDELETE(fDrawBufferVBAllocPool);
271 SkDELETE(fDrawBufferIBAllocPool); 270 SkDELETE(fDrawBufferIBAllocPool);
272 271
273 fDrawBuffer = NULL; 272 fDrawBuffer = NULL;
274 fDrawBufferVBAllocPool = NULL; 273 fDrawBufferVBAllocPool = NULL;
275 fDrawBufferIBAllocPool = NULL; 274 fDrawBufferIBAllocPool = NULL;
276 } 275 }
OLDNEW
« no previous file with comments | « src/gpu/GrTest.h ('k') | src/gpu/GrTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698