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

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

Issue 22850006: Replace uses of GrAssert by SkASSERT. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrRedBlackTree.h ('k') | src/gpu/GrResourceCache.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_Flag;
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 GrAssert(0 == fDeferredRefCount); 29 SkASSERT(0 == fDeferredRefCount);
30 GrAssert(!this->isValid()); 30 SkASSERT(!this->isValid());
31 } 31 }
32 32
33 void GrResource::release() { 33 void GrResource::release() {
34 if (NULL != fGpu) { 34 if (NULL != fGpu) {
35 this->onRelease(); 35 this->onRelease();
36 fGpu->removeResource(this); 36 fGpu->removeResource(this);
37 fGpu = NULL; 37 fGpu = NULL;
38 } 38 }
39 } 39 }
40 40
(...skipping 13 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/GrRedBlackTree.h ('k') | src/gpu/GrResourceCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698