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

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

Issue 24222004: Don't reuse scratch textures patch (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: check nothing changes Created 7 years, 1 month 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 | « src/gpu/GrContext.cpp ('k') | tests/ClipCacheTest.cpp » ('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 9
10 #include "GrResource.h" 10 #include "GrResource.h"
11 #include "GrGpu.h" 11 #include "GrGpu.h"
12 12
13 SK_DEFINE_INST_COUNT(GrResource) 13 SK_DEFINE_INST_COUNT(GrResource)
14 14
15 GrResource::GrResource(GrGpu* gpu, bool isWrapped) { 15 GrResource::GrResource(GrGpu* gpu, bool isWrapped) {
16 fGpu = gpu; 16 fGpu = gpu;
17 fCacheEntry = NULL; 17 fCacheEntry = NULL;
18 fDeferredRefCount = 0; 18 fDeferredRefCount = 0;
19 if (isWrapped) { 19 if (isWrapped) {
20 fFlags = kWrapped_Flag; 20 fFlags = kWrapped_FlagBit;
21 } else { 21 } else {
22 fFlags = 0; 22 fFlags = 0;
23 } 23 }
24 fGpu->insertResource(this); 24 fGpu->insertResource(this);
25 } 25 }
26 26
27 GrResource::~GrResource() { 27 GrResource::~GrResource() {
28 // subclass should have released this. 28 // subclass should have released this.
29 SkASSERT(0 == fDeferredRefCount); 29 SkASSERT(0 == fDeferredRefCount);
30 SkASSERT(!this->isValid()); 30 SkASSERT(!this->isValid());
(...skipping 23 matching lines...) Expand all
54 } 54 }
55 } 55 }
56 56
57 GrContext* GrResource::getContext() { 57 GrContext* GrResource::getContext() {
58 if (NULL != fGpu) { 58 if (NULL != fGpu) {
59 return fGpu->getContext(); 59 return fGpu->getContext();
60 } else { 60 } else {
61 return NULL; 61 return NULL;
62 } 62 }
63 } 63 }
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | tests/ClipCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698