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

Side by Side Diff: src/gpu/GrCacheable.cpp

Issue 414493002: Revert "Revert of Use the GrCacheable ID to eliminate the need for notifications to GrGpuGL when te… (Closed) Base URL: https://skia.googlesource.com/skia.git@removestuff
Patch Set: Address comments Created 6 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 8
9 #include "GrCacheable.h" 9 #include "GrCacheable.h"
10 10
11 uint32_t GrCacheable::getGenerationID() const { 11 uint32_t GrCacheable::CreateUniqueID() {
12 static int32_t gPathRefGenerationID; 12 static int32_t gCacheableID = SK_InvalidUniqueID;
13 while (!fGenID) { 13 uint32_t id;
14 fGenID = static_cast<uint32_t>(sk_atomic_inc(&gPathRefGenerationID) + 1) ; 14 do {
15 } 15 id = static_cast<uint32_t>(sk_atomic_inc(&gCacheableID) + 1);
robertphillips 2014/07/22 19:27:37 Is this test right?
bsalomon 2014/07/22 19:49:09 I'm losing it.
16 return fGenID; 16 } while (id != SK_InvalidUniqueID);
robertphillips 2014/07/22 19:27:37 SkASSERT(SK_InvalidUniqueID != id); ?
bsalomon 2014/07/22 19:49:09 With the corrected loop condition it seems unneces
17 return id;
17 } 18 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698