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

Unified Diff: src/gpu/GrGpuResource.cpp

Issue 510053003: Make textures register with GrResourceCache2 as scratch. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrGpuResource.cpp
diff --git a/src/gpu/GrGpuResource.cpp b/src/gpu/GrGpuResource.cpp
index a0a72785d9c74c0385e52d1b08da7beeac4eca99..9face916e7f65a79c34f565cbef3b2b9fa8783c8 100644
--- a/src/gpu/GrGpuResource.cpp
+++ b/src/gpu/GrGpuResource.cpp
@@ -22,7 +22,8 @@ GrGpuResource::GrGpuResource(GrGpu* gpu, bool isWrapped)
: fGpu(gpu)
, fRefCnt(1)
, fCacheEntry(NULL)
- , fUniqueID(CreateUniqueID()) {
+ , fUniqueID(CreateUniqueID())
+ , fScratchKey(GrResourceKey::NullScratchKey()) {
if (isWrapped) {
fFlags = kWrapped_FlagBit;
} else {
@@ -72,6 +73,12 @@ GrContext* GrGpuResource::getContext() {
}
}
+void GrGpuResource::setScratchKey(const GrResourceKey& scratchKey) {
+ SkASSERT(fScratchKey.isNullScratch());
robertphillips 2014/08/27 19:11:30 Do we want to assert that scratchKey is not null ?
bsalomon 2014/08/27 20:37:40 Done.
+ SkASSERT(scratchKey.isScratch());
+ fScratchKey = scratchKey;
+}
+
uint32_t GrGpuResource::CreateUniqueID() {
static int32_t gUniqueID = SK_InvalidUniqueID;
uint32_t id;

Powered by Google App Engine
This is Rietveld 408576698