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

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

Issue 796163002: Adding a custom data field to GrGpuResource (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ref Created 6 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
« no previous file with comments | « include/gpu/GrGpuResource.h ('k') | no next file » | 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 "GrGpuResource.h" 10 #include "GrGpuResource.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 50
51 void GrGpuResource::abandon() { 51 void GrGpuResource::abandon() {
52 SkASSERT(fGpu); 52 SkASSERT(fGpu);
53 this->onAbandon(); 53 this->onAbandon();
54 get_resource_cache2(fGpu)->resourceAccess().removeResource(this); 54 get_resource_cache2(fGpu)->resourceAccess().removeResource(this);
55 fGpu = NULL; 55 fGpu = NULL;
56 fGpuMemorySize = 0; 56 fGpuMemorySize = 0;
57 } 57 }
58 58
59 const SkData* GrGpuResource::setCustomData(const SkData* data) {
60 SkSafeRef(data);
61 fData.reset(data);
62 return data;
63 }
64
59 const GrContext* GrGpuResource::getContext() const { 65 const GrContext* GrGpuResource::getContext() const {
60 if (fGpu) { 66 if (fGpu) {
61 return fGpu->getContext(); 67 return fGpu->getContext();
62 } else { 68 } else {
63 return NULL; 69 return NULL;
64 } 70 }
65 } 71 }
66 72
67 GrContext* GrGpuResource::getContext() { 73 GrContext* GrGpuResource::getContext() {
68 if (fGpu) { 74 if (fGpu) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 uint32_t oldFlags = fFlags; 160 uint32_t oldFlags = fFlags;
155 if (countsAgainstBudget) { 161 if (countsAgainstBudget) {
156 fFlags |= kBudgeted_Flag; 162 fFlags |= kBudgeted_Flag;
157 } else { 163 } else {
158 fFlags &= ~kBudgeted_Flag; 164 fFlags &= ~kBudgeted_Flag;
159 } 165 }
160 if (fFlags != oldFlags) { 166 if (fFlags != oldFlags) {
161 get_resource_cache2(fGpu)->resourceAccess().didChangeBudgetStatus(this); 167 get_resource_cache2(fGpu)->resourceAccess().didChangeBudgetStatus(this);
162 } 168 }
163 } 169 }
OLDNEW
« no previous file with comments | « include/gpu/GrGpuResource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698