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

Unified Diff: src/gpu/GrBatchAtlas.h

Issue 1275393003: Fix for 510931, merge to m44 (Closed) Base URL: https://skia.googlesource.com/skia.git@m44
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrBatchAtlas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBatchAtlas.h
diff --git a/src/gpu/GrBatchAtlas.h b/src/gpu/GrBatchAtlas.h
index 83ef5ec732e345eafa5b2bb91d0700fc7038823a..4d21394c00d22f2eb2c81d63a51505e89b985d73 100644
--- a/src/gpu/GrBatchAtlas.h
+++ b/src/gpu/GrBatchAtlas.h
@@ -24,7 +24,7 @@ public:
typedef uint64_t BatchToken;
// An AtlasID is an opaque handle which callers can use to determine if the atlas contains
// a specific piece of data
- typedef uint32_t AtlasID;
+ typedef uint64_t AtlasID;
static const uint32_t kInvalidAtlasID = 0;
static const uint64_t kInvalidAtlasGeneration = 0;
@@ -67,6 +67,11 @@ public:
class BulkUseTokenUpdater {
public:
BulkUseTokenUpdater() : fPlotAlreadyUpdated(0) {}
+ BulkUseTokenUpdater(const BulkUseTokenUpdater& that)
+ : fPlotsToUpdate(that.fPlotsToUpdate)
+ , fPlotAlreadyUpdated(that.fPlotAlreadyUpdated) {
+ }
+
void add(AtlasID id) {
int index = GrBatchAtlas::GetIndexFromID(id);
if (!this->find(index)) {
@@ -107,12 +112,13 @@ public:
}
private:
- static int GetIndexFromID(AtlasID id) {
+ static uint32_t GetIndexFromID(AtlasID id) {
return id & 0xffff;
}
- static int GetGenerationFromID(AtlasID id) {
- return (id >> 16) & 0xffff;
+ // top 48 bits are reserved for the generation ID
+ static uint64_t GetGenerationFromID(AtlasID id) {
+ return (id >> 16) & 0xffffffffffff;
}
inline void updatePlot(GrBatchTarget*, AtlasID*, BatchPlot*);
@@ -122,10 +128,10 @@ private:
inline void processEviction(AtlasID);
GrTexture* fTexture;
- int fNumPlotsX;
- int fNumPlotsY;
- int fPlotWidth;
- int fPlotHeight;
+ uint32_t fNumPlotsX;
+ uint32_t fNumPlotsY;
+ uint32_t fPlotWidth;
+ uint32_t fPlotHeight;
size_t fBPP;
uint64_t fAtlasGeneration;
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrBatchAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698