diff options
author | Timothy Liang <timliang@google.com> | 2018-06-15 10:12:00 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-15 15:39:45 +0000 |
commit | 0513dd8675534afdd605cea32778a4b4671b2c3d (patch) | |
tree | d8fff7fc5969aebbf6310605404ffa083c1e97cd /src/gpu/text/GrGlyphCache.h | |
parent | 702fe01aab9e41474f0fc33b54290c49f5ead5e0 (diff) |
Reland "added 565 to 8888 conversion for gpu LCD text rendering for macOS"
This reverts commit cf274da6faa9d32e08053180c8113fcaab666028.
Reason for revert: removed the static initializer
Original change's description:
> Revert "added 565 to 8888 conversion for gpu LCD text rendering for macOS"
>
> This reverts commit e6f2ecafaf0efecacfd4256f280e26ee74cb7e16.
>
> Reason for revert: breaking chrome roll cause of static initializers
>
> Original change's description:
> > added 565 to 8888 conversion for gpu LCD text rendering for macOS
> >
> > Bug: skia:
> > Change-Id: Ie24160bb098d388bf4ad69d0c2f9f8ed4beb215c
> > Reviewed-on: https://skia-review.googlesource.com/134508
> > Commit-Queue: Timothy Liang <timliang@google.com>
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
>
> TBR=egdaniel@google.com,jvanverth@google.com,timliang@google.com
>
> Change-Id: Ida97a4085c93fcb990999ab71f99364ec2ef86b7
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/135000
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: I40c29b73970c55b3579a0169bbad666a798b2348
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/135021
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Timothy Liang <timliang@google.com>
Diffstat (limited to 'src/gpu/text/GrGlyphCache.h')
-rw-r--r-- | src/gpu/text/GrGlyphCache.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gpu/text/GrGlyphCache.h b/src/gpu/text/GrGlyphCache.h index 7e707ec64c..68386d2c1c 100644 --- a/src/gpu/text/GrGlyphCache.h +++ b/src/gpu/text/GrGlyphCache.h @@ -12,6 +12,7 @@ #include "GrGlyph.h" #include "SkArenaAlloc.h" #include "SkGlyphCache.h" +#include "SkMasks.h" #include "SkTDynamicHash.h" class GrGlyphCache; @@ -108,6 +109,8 @@ private: */ class GrGlyphCache { public: + static std::unique_ptr<const SkMasks> k565Masks; + GrGlyphCache(const GrCaps* caps, size_t maxTextureBytes); ~GrGlyphCache(); @@ -129,6 +132,14 @@ public: void freeAll(); + static void InitMask() { + static SkOnce once; + once([] { + k565Masks.reset(SkMasks::CreateMasks({0xF800, 0x07E0, 0x001F, 0}, + GrMaskFormatBytesPerPixel(kA565_GrMaskFormat) * 8)); + }); + } + static void HandleEviction(GrDrawOpAtlas::AtlasID, void*); static SkScalar ComputeGlyphSizeLimit(int maxTextureSize, size_t maxTextureBytes); |