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

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: add new h file to git repo 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
« no previous file with comments | « src/gpu/GrBinHashKey.h ('k') | src/gpu/GrMurmur3HashKey.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpuResource.cpp
diff --git a/src/gpu/GrGpuResource.cpp b/src/gpu/GrGpuResource.cpp
index a0a72785d9c74c0385e52d1b08da7beeac4eca99..bce7d2cae8b9c85661d1c9be14c9c63dd9ad5c53 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,13 @@ GrContext* GrGpuResource::getContext() {
}
}
+void GrGpuResource::setScratchKey(const GrResourceKey& scratchKey) {
+ SkASSERT(fScratchKey.isNullScratch());
+ SkASSERT(scratchKey.isScratch());
+ SkASSERT(!scratchKey.isNullScratch());
+ fScratchKey = scratchKey;
+}
+
uint32_t GrGpuResource::CreateUniqueID() {
static int32_t gUniqueID = SK_InvalidUniqueID;
uint32_t id;
« no previous file with comments | « src/gpu/GrBinHashKey.h ('k') | src/gpu/GrMurmur3HashKey.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698