aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrLayerCache.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-12-03 07:33:57 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-03 07:33:57 -0800
commite99d499caa7dbc80b58e0faf5ce137e7d30cc5d0 (patch)
tree51fbc4f33ad173c3504998826e6333d99cb67f3f /src/gpu/GrLayerCache.cpp
parent2dd1ae016d7f297b433c3ea3a771ef8e01657c1f (diff)
Fuse GrReplacements and GrLayerCache
The conversion step from GrCachedLayer to ReplacementInfo isn't necessary. Review URL: https://codereview.chromium.org/769533004
Diffstat (limited to 'src/gpu/GrLayerCache.cpp')
-rw-r--r--src/gpu/GrLayerCache.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gpu/GrLayerCache.cpp b/src/gpu/GrLayerCache.cpp
index c347512188..fc5be5fd05 100644
--- a/src/gpu/GrLayerCache.cpp
+++ b/src/gpu/GrLayerCache.cpp
@@ -125,7 +125,7 @@ GrCachedLayer* GrLayerCache::createLayer(uint32_t pictureID,
int start, int stop,
const SkIRect& bounds,
const SkMatrix& initialMat,
- const int* key,
+ const unsigned* key,
int keySize,
const SkPaint* paint) {
SkASSERT(pictureID != SK_InvalidGenID && start >= 0 && stop > 0);
@@ -137,7 +137,7 @@ GrCachedLayer* GrLayerCache::createLayer(uint32_t pictureID,
}
GrCachedLayer* GrLayerCache::findLayer(uint32_t pictureID, const SkMatrix& initialMat,
- const int* key, int keySize) {
+ const unsigned* key, int keySize) {
SkASSERT(pictureID != SK_InvalidGenID);
return fLayerHash.find(GrCachedLayer::Key(pictureID, initialMat, key, keySize));
}
@@ -146,7 +146,7 @@ GrCachedLayer* GrLayerCache::findLayerOrCreate(uint32_t pictureID,
int start, int stop,
const SkIRect& bounds,
const SkMatrix& initialMat,
- const int* key,
+ const unsigned* key,
int keySize,
const SkPaint* paint) {
SkASSERT(pictureID != SK_InvalidGenID && start >= 0 && stop > 0);
@@ -209,9 +209,8 @@ bool GrLayerCache::tryToAtlas(GrCachedLayer* layer,
pictInfo->incPlotUsage(plot->id());
#endif
// The layer was successfully added to the atlas
- GrIRect16 bounds = GrIRect16::MakeXYWH(loc.fX, loc.fY,
- SkToS16(desc.fWidth),
- SkToS16(desc.fHeight));
+ const SkIRect bounds = SkIRect::MakeXYWH(loc.fX, loc.fY,
+ desc.fWidth, desc.fHeight);
layer->setTexture(fAtlas->getTexture(), bounds);
layer->setPlot(plot);
layer->setLocked(true);
@@ -250,7 +249,7 @@ bool GrLayerCache::lock(GrCachedLayer* layer, const GrSurfaceDesc& desc, bool* n
return false;
}
- layer->setTexture(tex, GrIRect16::MakeWH(SkToS16(desc.fWidth), SkToS16(desc.fHeight)));
+ layer->setTexture(tex, SkIRect::MakeWH(desc.fWidth, desc.fHeight));
layer->setLocked(true);
*needsRendering = true;
return true;
@@ -289,11 +288,11 @@ void GrLayerCache::unlock(GrCachedLayer* layer) {
}
layer->setPlot(NULL);
- layer->setTexture(NULL, GrIRect16::MakeEmpty());
+ layer->setTexture(NULL, SkIRect::MakeEmpty());
#endif
} else {
- layer->setTexture(NULL, GrIRect16::MakeEmpty());
+ layer->setTexture(NULL, SkIRect::MakeEmpty());
}
layer->setLocked(false);