| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrTextureProvider.h" | 8 #include "GrTextureProvider.h" |
| 9 #include "GrTexturePriv.h" | 9 #include "GrTexturePriv.h" |
| 10 #include "GrResourceCache.h" | 10 #include "GrResourceCache.h" |
| 11 #include "GrGpu.h" | 11 #include "GrGpu.h" |
| 12 #include "../private/GrSingleOwner.h" | 12 #include "../private/GrSingleOwner.h" |
| 13 #include "SkMathPriv.h" |
| 13 #include "SkTArray.h" | 14 #include "SkTArray.h" |
| 14 | 15 |
| 15 #define ASSERT_SINGLE_OWNER \ | 16 #define ASSERT_SINGLE_OWNER \ |
| 16 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fSingleOwner);) | 17 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fSingleOwner);) |
| 17 | 18 |
| 18 enum ScratchTextureFlags { | 19 enum ScratchTextureFlags { |
| 19 kExact_ScratchTextureFlag = 0x1, | 20 kExact_ScratchTextureFlag = 0x1, |
| 20 kNoPendingIO_ScratchTextureFlag = 0x2, | 21 kNoPendingIO_ScratchTextureFlag = 0x2, |
| 21 kNoCreate_ScratchTextureFlag = 0x4, | 22 kNoCreate_ScratchTextureFlag = 0x4, |
| 22 }; | 23 }; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 GrTexture* GrTextureProvider::findAndRefTextureByUniqueKey(const GrUniqueKey& ke
y) { | 192 GrTexture* GrTextureProvider::findAndRefTextureByUniqueKey(const GrUniqueKey& ke
y) { |
| 192 ASSERT_SINGLE_OWNER | 193 ASSERT_SINGLE_OWNER |
| 193 GrGpuResource* resource = this->findAndRefResourceByUniqueKey(key); | 194 GrGpuResource* resource = this->findAndRefResourceByUniqueKey(key); |
| 194 if (resource) { | 195 if (resource) { |
| 195 GrTexture* texture = static_cast<GrSurface*>(resource)->asTexture(); | 196 GrTexture* texture = static_cast<GrSurface*>(resource)->asTexture(); |
| 196 SkASSERT(texture); | 197 SkASSERT(texture); |
| 197 return texture; | 198 return texture; |
| 198 } | 199 } |
| 199 return NULL; | 200 return NULL; |
| 200 } | 201 } |
| OLD | NEW |