Rename TestingPeer to GlyphVectorTestingPeer

Change-Id: Ie3378350f096e6e8baf96a093df70c7a76683072
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/557057
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Herb Derby 2022-07-08 13:08:33 -04:00 committed by SkCQ
parent 6c8fd3f97d
commit 56391549a2
2 changed files with 7 additions and 5 deletions

View File

@ -85,7 +85,7 @@ public:
}
private:
friend class TestingPeer;
friend class GlyphVectorTestingPeer;
static Variant* MakeGlyphs(SkSpan<SkGlyphVariant> glyphs, SubRunAllocator* alloc);

View File

@ -22,7 +22,7 @@ using SubRunAllocator = sktext::gpu::SubRunAllocator;
namespace sktext::gpu {
class TestingPeer {
class GlyphVectorTestingPeer {
public:
static const SkDescriptor& GetDescriptor(const GlyphVector& v) {
return std::get<sk_sp<SkStrike>>(v.fStrike)->getDescriptor();
@ -55,10 +55,12 @@ DEF_TEST(GlyphVector_Serialization, r) {
SkReadBuffer rBuffer{data->data(), data->size()};
auto dst = GlyphVector::MakeFromBuffer(rBuffer, nullptr, &alloc);
REPORTER_ASSERT(r, dst.has_value());
REPORTER_ASSERT(r, TestingPeer::GetDescriptor(src) == TestingPeer::GetDescriptor(*dst));
REPORTER_ASSERT(r,
GlyphVectorTestingPeer::GetDescriptor(src) ==
GlyphVectorTestingPeer::GetDescriptor(*dst));
auto srcGlyphs = TestingPeer::GetGlyphs(src);
auto dstGlyphs = TestingPeer::GetGlyphs(*dst);
auto srcGlyphs = GlyphVectorTestingPeer::GetGlyphs(src);
auto dstGlyphs = GlyphVectorTestingPeer::GetGlyphs(*dst);
for (auto [srcGlyphID, dstGlyphID] : SkMakeZip(srcGlyphs, dstGlyphs)) {
REPORTER_ASSERT(r, srcGlyphID.packedGlyphID == dstGlyphID.packedGlyphID);
}