| 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" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 GrTexture* GrTextureProvider::findAndRefTextureByUniqueKey(const GrUniqueKey& ke
y) { | 192 GrTexture* GrTextureProvider::findAndRefTextureByUniqueKey(const GrUniqueKey& ke
y) { |
| 193 ASSERT_SINGLE_OWNER | 193 ASSERT_SINGLE_OWNER |
| 194 GrGpuResource* resource = this->findAndRefResourceByUniqueKey(key); | 194 GrGpuResource* resource = this->findAndRefResourceByUniqueKey(key); |
| 195 if (resource) { | 195 if (resource) { |
| 196 GrTexture* texture = static_cast<GrSurface*>(resource)->asTexture(); | 196 GrTexture* texture = static_cast<GrSurface*>(resource)->asTexture(); |
| 197 SkASSERT(texture); | 197 SkASSERT(texture); |
| 198 return texture; | 198 return texture; |
| 199 } | 199 } |
| 200 return NULL; | 200 return NULL; |
| 201 } | 201 } |
| 202 |
| 203 GrRenderTarget* GrTextureProvider::findAndRefRenderTargetByUniqueKey(const GrUni
queKey& key) { |
| 204 ASSERT_SINGLE_OWNER |
| 205 GrGpuResource* resource = this->findAndRefResourceByUniqueKey(key); |
| 206 if (resource) { |
| 207 GrRenderTarget* rt = static_cast<GrSurface*>(resource)->asRenderTarget()
; |
| 208 SkASSERT(rt); |
| 209 return rt; |
| 210 } |
| 211 return nullptr; |
| 212 } |
| OLD | NEW |