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

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

Issue 1623653002: skia: Add support for CHROMIUM_image backed textures. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Comments from bsalomon, round four. Created 4 years, 10 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 /* 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 #include "GrGpuResource.h" 9 #include "GrGpuResource.h"
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 if (this->isPurgeable()) { 66 if (this->isPurgeable()) {
67 traceMemoryDump->dumpNumericValue(dumpName.c_str(), "purgeable_size", "b ytes", 67 traceMemoryDump->dumpNumericValue(dumpName.c_str(), "purgeable_size", "b ytes",
68 this->gpuMemorySize()); 68 this->gpuMemorySize());
69 } 69 }
70 70
71 // Call setMemoryBacking to allow sub-classes with implementation specific b ackings (such as GL 71 // Call setMemoryBacking to allow sub-classes with implementation specific b ackings (such as GL
72 // objects) to provide additional information. 72 // objects) to provide additional information.
73 this->setMemoryBacking(traceMemoryDump, dumpName); 73 this->setMemoryBacking(traceMemoryDump, dumpName);
74 } 74 }
75 75
76 bool GrGpuResource::reuseable() const {
77 return true;
78 }
79
76 const SkData* GrGpuResource::setCustomData(const SkData* data) { 80 const SkData* GrGpuResource::setCustomData(const SkData* data) {
77 SkSafeRef(data); 81 SkSafeRef(data);
78 fData.reset(data); 82 fData.reset(data);
79 return data; 83 return data;
80 } 84 }
81 85
82 const GrContext* GrGpuResource::getContext() const { 86 const GrContext* GrGpuResource::getContext() const {
83 if (fGpu) { 87 if (fGpu) {
84 return fGpu->getContext(); 88 return fGpu->getContext();
85 } else { 89 } else {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 } 202 }
199 203
200 uint32_t GrGpuResource::CreateUniqueID() { 204 uint32_t GrGpuResource::CreateUniqueID() {
201 static int32_t gUniqueID = SK_InvalidUniqueID; 205 static int32_t gUniqueID = SK_InvalidUniqueID;
202 uint32_t id; 206 uint32_t id;
203 do { 207 do {
204 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); 208 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1);
205 } while (id == SK_InvalidUniqueID); 209 } while (id == SK_InvalidUniqueID);
206 return id; 210 return id;
207 } 211 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698