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/GrGpuResource.cpp

Issue 2291203002: Remove custom data from GrGpuResource (Closed)
Patch Set: Created 4 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrGpuResource.h" 8 #include "GrGpuResource.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrResourceCache.h" 10 #include "GrResourceCache.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 if (this->isPurgeable()) { 76 if (this->isPurgeable()) {
77 traceMemoryDump->dumpNumericValue(dumpName.c_str(), "purgeable_size", "b ytes", 77 traceMemoryDump->dumpNumericValue(dumpName.c_str(), "purgeable_size", "b ytes",
78 this->gpuMemorySize()); 78 this->gpuMemorySize());
79 } 79 }
80 80
81 // Call setMemoryBacking to allow sub-classes with implementation specific b ackings (such as GL 81 // Call setMemoryBacking to allow sub-classes with implementation specific b ackings (such as GL
82 // objects) to provide additional information. 82 // objects) to provide additional information.
83 this->setMemoryBacking(traceMemoryDump, dumpName); 83 this->setMemoryBacking(traceMemoryDump, dumpName);
84 } 84 }
85 85
86 const SkData* GrGpuResource::setCustomData(const SkData* data) {
87 SkSafeRef(data);
88 fData.reset(data);
89 return data;
90 }
91
92 const GrContext* GrGpuResource::getContext() const { 86 const GrContext* GrGpuResource::getContext() const {
93 if (fGpu) { 87 if (fGpu) {
94 return fGpu->getContext(); 88 return fGpu->getContext();
95 } else { 89 } else {
96 return nullptr; 90 return nullptr;
97 } 91 }
98 } 92 }
99 93
100 GrContext* GrGpuResource::getContext() { 94 GrContext* GrGpuResource::getContext() {
101 if (fGpu) { 95 if (fGpu) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 194 }
201 195
202 uint32_t GrGpuResource::CreateUniqueID() { 196 uint32_t GrGpuResource::CreateUniqueID() {
203 static int32_t gUniqueID = SK_InvalidUniqueID; 197 static int32_t gUniqueID = SK_InvalidUniqueID;
204 uint32_t id; 198 uint32_t id;
205 do { 199 do {
206 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); 200 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1);
207 } while (id == SK_InvalidUniqueID); 201 } while (id == SK_InvalidUniqueID);
208 return id; 202 return id;
209 } 203 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698