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

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

Issue 117583002: Update bench pictures to time image decode & upload costs (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fixed comment Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « include/gpu/GrContext.h ('k') | tools/PictureBenchmark.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 "GrGpu.h" 11 #include "GrGpu.h"
12 #include "GrResourceCache.h"
12 13
13 void GrTestTarget::init(GrContext* ctx, GrDrawTarget* target) { 14 void GrTestTarget::init(GrContext* ctx, GrDrawTarget* target) {
14 SkASSERT(!fContext); 15 SkASSERT(!fContext);
15 16
16 fContext.reset(SkRef(ctx)); 17 fContext.reset(SkRef(ctx));
17 fDrawTarget.reset(SkRef(target)); 18 fDrawTarget.reset(SkRef(target));
18 19
19 SkNEW_IN_TLAZY(&fASR, GrDrawTarget::AutoStateRestore, (target, GrDrawTarget: :kReset_ASRInit)); 20 SkNEW_IN_TLAZY(&fASR, GrDrawTarget::AutoStateRestore, (target, GrDrawTarget: :kReset_ASRInit));
20 SkNEW_IN_TLAZY(&fACR, GrDrawTarget::AutoClipRestore, (target)); 21 SkNEW_IN_TLAZY(&fACR, GrDrawTarget::AutoClipRestore, (target));
21 SkNEW_IN_TLAZY(&fAGP, GrDrawTarget::AutoGeometryPush, (target)); 22 SkNEW_IN_TLAZY(&fAGP, GrDrawTarget::AutoGeometryPush, (target));
22 } 23 }
23 24
24 void GrContext::getTestTarget(GrTestTarget* tar) { 25 void GrContext::getTestTarget(GrTestTarget* tar) {
25 this->flush(); 26 this->flush();
26 // 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
27 // 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
28 // 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
29 // until ~GrTestTarget(). 30 // until ~GrTestTarget().
30 tar->init(this, fGpu); 31 tar->init(this, fGpu);
31 } 32 }
32 33
33 /////////////////////////////////////////////////////////////////////////////// 34 ///////////////////////////////////////////////////////////////////////////////
34 35
35 void GrContext::setMaxTextureSizeOverride(int maxTextureSizeOverride) { 36 void GrContext::setMaxTextureSizeOverride(int maxTextureSizeOverride) {
36 fMaxTextureSizeOverride = maxTextureSizeOverride; 37 fMaxTextureSizeOverride = maxTextureSizeOverride;
37 } 38 }
39
40 void GrContext::purgeAllUnlockedResources() {
41 fTextureCache->purgeAllUnlocked();
42 }
OLDNEW
« no previous file with comments | « include/gpu/GrContext.h ('k') | tools/PictureBenchmark.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698