Chromium Code Reviews| 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; |