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

Side by Side Diff: src/gpu/effects/GrTextureStripAtlas.cpp

Issue 2262233002: Make GrTextureStripAtlas flush pending IO on newly acquired texture (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Address comments Created 4 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 unified diff | Download patch
« no previous file with comments | « src/gpu/effects/GrTextureStripAtlas.h ('k') | tests/GrTextureStripAtlasTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // We will be issuing writes to the surface using kDontFlush_PixelOpsFla g, so we
214 // need to make sure any existing IO is flushed
215 fDesc.fContext->flushSurfaceIO(fTexture);
212 fDesc.fContext->textureProvider()->assignUniqueKeyToTexture(key, fTextur e); 216 fDesc.fContext->textureProvider()->assignUniqueKeyToTexture(key, fTextur e);
213 // This is a new texture, so all of our cache info is now invalid 217 // This is a new texture, so all of our cache info is now invalid
214 this->initLRU(); 218 this->initLRU();
215 fKeyTable.rewind(); 219 fKeyTable.rewind();
216 } 220 }
217 SkASSERT(fTexture); 221 SkASSERT(fTexture);
218 } 222 }
219 223
220 void GrTextureStripAtlas::unlockTexture() { 224 void GrTextureStripAtlas::unlockTexture() {
221 SkASSERT(fTexture && 0 == fLockedRows); 225 SkASSERT(fTexture && 0 == fLockedRows);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 347
344 // If we have locked rows, we should have a locked texture, otherwise 348 // If we have locked rows, we should have a locked texture, otherwise
345 // it should be unlocked 349 // it should be unlocked
346 if (fLockedRows == 0) { 350 if (fLockedRows == 0) {
347 SkASSERT(nullptr == fTexture); 351 SkASSERT(nullptr == fTexture);
348 } else { 352 } else {
349 SkASSERT(fTexture); 353 SkASSERT(fTexture);
350 } 354 }
351 } 355 }
352 #endif 356 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrTextureStripAtlas.h ('k') | tests/GrTextureStripAtlasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698