Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrTextureStripAtlas.h" | 8 #include "GrTextureStripAtlas.h" |
| 9 #include "GrContext.h" | 9 #include "GrContext.h" |
| 10 #include "GrTexture.h" | 10 #include "GrTexture.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 builder[0] = static_cast<uint32_t>(fCacheKey); | 202 builder[0] = static_cast<uint32_t>(fCacheKey); |
| 203 builder.finish(); | 203 builder.finish(); |
| 204 | 204 |
| 205 fTexture = fDesc.fContext->textureProvider()->findAndRefTextureByUniqueKey(k ey); | 205 fTexture = fDesc.fContext->textureProvider()->findAndRefTextureByUniqueKey(k ey); |
| 206 if (nullptr == fTexture) { | 206 if (nullptr == fTexture) { |
| 207 fTexture = fDesc.fContext->textureProvider()->createTexture(texDesc, SkB udgeted::kYes, | 207 fTexture = fDesc.fContext->textureProvider()->createTexture(texDesc, SkB udgeted::kYes, |
| 208 nullptr, 0); | 208 nullptr, 0); |
| 209 if (!fTexture) { | 209 if (!fTexture) { |
| 210 return; | 210 return; |
| 211 } | 211 } |
| 212 | |
| 213 fDesc.fContext->flushSurfaceIO(fTexture); | |
|
bsalomon
2016/08/22 16:52:57
Could you add a comment here that we need to do th
ajuma
2016/08/24 13:12:39
Done.
| |
| 212 fDesc.fContext->textureProvider()->assignUniqueKeyToTexture(key, fTextur e); | 214 fDesc.fContext->textureProvider()->assignUniqueKeyToTexture(key, fTextur e); |
| 213 // This is a new texture, so all of our cache info is now invalid | 215 // This is a new texture, so all of our cache info is now invalid |
| 214 this->initLRU(); | 216 this->initLRU(); |
| 215 fKeyTable.rewind(); | 217 fKeyTable.rewind(); |
| 216 } | 218 } |
| 217 SkASSERT(fTexture); | 219 SkASSERT(fTexture); |
| 218 } | 220 } |
| 219 | 221 |
| 220 void GrTextureStripAtlas::unlockTexture() { | 222 void GrTextureStripAtlas::unlockTexture() { |
| 221 SkASSERT(fTexture && 0 == fLockedRows); | 223 SkASSERT(fTexture && 0 == fLockedRows); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 343 | 345 |
| 344 // If we have locked rows, we should have a locked texture, otherwise | 346 // If we have locked rows, we should have a locked texture, otherwise |
| 345 // it should be unlocked | 347 // it should be unlocked |
| 346 if (fLockedRows == 0) { | 348 if (fLockedRows == 0) { |
| 347 SkASSERT(nullptr == fTexture); | 349 SkASSERT(nullptr == fTexture); |
| 348 } else { | 350 } else { |
| 349 SkASSERT(fTexture); | 351 SkASSERT(fTexture); |
| 350 } | 352 } |
| 351 } | 353 } |
| 352 #endif | 354 #endif |
| OLD | NEW |