aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPath.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-01-23 04:24:04 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-23 04:24:05 -0800
commit24db3b1c35fb935660229da164fc5ad31977387f (patch)
treebe22e794f54605ff37ef09df79b3e0869572b053 /src/gpu/GrPath.cpp
parentf98f2bb0e72df68320f707c8584e3c877ce98ec3 (diff)
Add specialized content key class for resources.
Diffstat (limited to 'src/gpu/GrPath.cpp')
-rw-r--r--src/gpu/GrPath.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gpu/GrPath.cpp b/src/gpu/GrPath.cpp
index eb956fbf65..a069b0ad1e 100644
--- a/src/gpu/GrPath.cpp
+++ b/src/gpu/GrPath.cpp
@@ -13,15 +13,11 @@ template<int NumBits> static uint64_t get_top_n_float_bits(float f) {
return floatBits >> (32 - NumBits);
}
-GrResourceKey GrPath::ComputeKey(const SkPath& path, const SkStrokeRec& stroke) {
- static const GrCacheID::Domain gPathDomain = GrCacheID::GenerateDomain();
-
- GrCacheID::Key key;
- uint64_t* keyData = key.fData64;
- keyData[0] = path.getGenerationID();
- keyData[1] = ComputeStrokeKey(stroke);
-
- return GrResourceKey(GrCacheID(gPathDomain, key), 0);
+void GrPath::ComputeKey(const SkPath& path, const SkStrokeRec& stroke, GrContentKey* key) {
+ static const GrContentKey::Domain kDomain = GrContentKey::GenerateDomain();
+ GrContentKey::Builder builder(key, kDomain, 3);
+ *reinterpret_cast<uint64_t*>(&builder[0]) = ComputeStrokeKey(stroke);
+ builder[2] = path.getGenerationID();
}
uint64_t GrPath::ComputeStrokeKey(const SkStrokeRec& stroke) {