aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrLayerCache.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-08-19 09:51:00 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-19 09:51:01 -0700
commitc6ad06acefa096716f8dabed5342f9b89dc43dfe (patch)
treed7f0f880609d4e7876790a846cdbab4702590109 /src/gpu/GrLayerCache.h
parent4b013296bf67df6c8d119a8f5a2b3dd6530c0b6f (diff)
unsigned -> int for counts and indices in picture-related code
also, (C) BUG=skia: Review URL: https://codereview.chromium.org/1300163002
Diffstat (limited to 'src/gpu/GrLayerCache.h')
-rw-r--r--src/gpu/GrLayerCache.h52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/gpu/GrLayerCache.h b/src/gpu/GrLayerCache.h
index df8c670689..cf35de80b5 100644
--- a/src/gpu/GrLayerCache.h
+++ b/src/gpu/GrLayerCache.h
@@ -31,9 +31,9 @@ public:
static uint32_t Hash(const uint32_t& key) { return SkChecksum::Mix(key); }
// GrPictureInfo proper
- GrPictureInfo(uint32_t pictureID) : fPictureID(pictureID) {
+ GrPictureInfo(uint32_t pictureID) : fPictureID(pictureID) {
#if !GR_CACHE_HOISTED_LAYERS
- memset(fPlotUses, 0, sizeof(fPlotUses));
+ memset(fPlotUses, 0, sizeof(fPlotUses));
#endif
}
@@ -49,7 +49,7 @@ public:
fPlotUses[plotID]--;
}
- int plotUsage(int plotID) const {
+ int plotUsage(int plotID) const {
SkASSERT(plotID < kNumPlots);
return fPlotUses[plotID];
}
@@ -67,7 +67,7 @@ private:
// GrCachedLayer encapsulates the caching information for a single saveLayer.
//
// Atlased layers get a ref to the backing GrTexture while non-atlased layers
-// get a ref to the GrTexture in which they reside. In both cases 'fRect'
+// get a ref to the GrTexture in which they reside. In both cases 'fRect'
// contains the layer's extent in its texture.
// Atlased layers also get a pointer to the plot in which they reside.
// For non-atlased layers, the lock field just corresponds to locking in
@@ -77,17 +77,17 @@ struct GrCachedLayer {
public:
// For SkTDynamicHash
struct Key {
- Key(uint32_t pictureID, const SkMatrix& initialMat,
- const unsigned* key, int keySize, bool copyKey = false)
- : fKeySize(keySize)
+ Key(uint32_t pictureID, const SkMatrix& initialMat,
+ const int* key, int keySize, bool copyKey = false)
+ : fKeySize(keySize)
, fFreeKey(copyKey) {
fIDMatrix.fPictureID = pictureID;
fIDMatrix.fInitialMat = initialMat;
fIDMatrix.fInitialMat.getType(); // force initialization of type so hashes match
if (copyKey) {
- unsigned* tempKey = SkNEW_ARRAY(unsigned, keySize);
- memcpy(tempKey, key, keySize*sizeof(unsigned));
+ int* tempKey = SkNEW_ARRAY(int, keySize);
+ memcpy(tempKey, key, keySize*sizeof(int));
fKey = tempKey;
} else {
fKey = key;
@@ -116,13 +116,13 @@ public:
uint32_t pictureID() const { return fIDMatrix.fPictureID; }
// TODO: remove these when GrCachedLayer & ReplacementInfo fuse
- const unsigned* key() const { SkASSERT(fFreeKey); return fKey; }
+ const int* key() const { SkASSERT(fFreeKey); return fKey; }
int keySize() const { SkASSERT(fFreeKey); return fKeySize; }
uint32_t hash() const {
uint32_t hash = SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(fKey),
fKeySize * sizeof(int));
- return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(&fIDMatrix),
+ return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(&fIDMatrix),
sizeof(IDMatrix), hash);
}
@@ -134,19 +134,19 @@ public:
SkMatrix fInitialMat;
} fIDMatrix;
- const unsigned* fKey;
- const int fKeySize;
- bool fFreeKey;
+ const int* fKey;
+ const int fKeySize;
+ bool fFreeKey;
};
static const Key& GetKey(const GrCachedLayer& layer) { return layer.fKey; }
static uint32_t Hash(const Key& key) { return key.hash(); }
// GrCachedLayer proper
- GrCachedLayer(uint32_t pictureID, unsigned start, unsigned stop,
+ GrCachedLayer(uint32_t pictureID, int start, int stop,
const SkIRect& srcIR, const SkIRect& dstIR,
const SkMatrix& ctm,
- const unsigned* key, int keySize,
+ const int* key, int keySize,
const SkPaint* paint)
: fKey(pictureID, ctm, key, keySize, true)
, fStart(start)
@@ -179,14 +179,14 @@ public:
uint32_t pictureID() const { return fKey.pictureID(); }
// TODO: remove these when GrCachedLayer & ReplacementInfo fuse
- const unsigned* key() const { return fKey.key(); }
+ const int* key() const { return fKey.key(); }
int keySize() const { return fKey.keySize(); }
- unsigned start() const { return fStart; }
+ int start() const { return fStart; }
// TODO: make bound debug only
const SkIRect& srcIR() const { return fSrcIR; }
const SkIRect& dstIR() const { return fDstIR; }
- unsigned stop() const { return fStop; }
+ int stop() const { return fStop; }
void setTexture(GrTexture* texture, const SkIRect& rect) {
SkRefCnt_SafeAssign(fTexture, texture);
fRect = rect;
@@ -220,9 +220,9 @@ private:
const Key fKey;
// The "saveLayer" operation index of the cached layer
- const unsigned fStart;
+ const int fStart;
// The final "restore" operation index of the cached layer
- const unsigned fStop;
+ const int fStop;
// The layer's src rect (i.e., the portion of the source scene required
// for filtering).
@@ -291,13 +291,13 @@ public:
void freeAll();
GrCachedLayer* findLayer(uint32_t pictureID, const SkMatrix& ctm,
- const unsigned* key, int keySize);
+ const int* key, int keySize);
GrCachedLayer* findLayerOrCreate(uint32_t pictureID,
- int start, int stop,
+ int start, int stop,
const SkIRect& srcIR,
const SkIRect& dstIR,
const SkMatrix& initialMat,
- const unsigned* key, int keySize,
+ const int* key, int keySize,
const SkPaint* paint);
// Attempt to place 'layer' in the atlas. Return true on success; false on failure.
@@ -357,7 +357,7 @@ private:
// We cache this information here (rather then, say, on the owning picture)
// because we want to be able to clean it up as needed (e.g., if a picture
- // is leaked and never cleans itself up we still want to be able to
+ // is leaked and never cleans itself up we still want to be able to
// remove the GrPictureInfo once its layers are purged from all the atlas
// plots).
SkTDynamicHash<GrPictureInfo, uint32_t> fPictureHash;
@@ -381,7 +381,7 @@ private:
GrCachedLayer* createLayer(uint32_t pictureID, int start, int stop,
const SkIRect& srcIR, const SkIRect& dstIR,
const SkMatrix& initialMat,
- const unsigned* key, int keySize,
+ const int* key, int keySize,
const SkPaint* paint);
// Remove all the layers (and unlock any resources) associated with 'pictureID'