Skip to content

Commit

Permalink
Introduce FitsInAtlas
Browse files Browse the repository at this point in the history
Change-Id: I043c593f748da196abb0310bc0bc8302ca33e5af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250798
Reviewed-by: Ben Wagner <[email protected]>
Commit-Queue: Herb Derby <[email protected]>
  • Loading branch information
herbderby authored and Skia Commit-Bot committed Oct 25, 2019
1 parent bdf2c87 commit d0a404e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/core/SkStrikeForGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@
#include "src/core/SkGlyphRunPainter.h"

bool SkStrikeForGPU::CanDrawAsMask(const SkGlyph& glyph) {
return glyph.maxDimension() <= SkStrikeCommon::kSkSideTooBigForAtlas;
return FitsInAtlas(glyph);
}

bool SkStrikeForGPU::CanDrawAsSDFT(const SkGlyph& glyph) {
return glyph.maxDimension() <= SkStrikeCommon::kSkSideTooBigForAtlas
&& glyph.maskFormat() == SkMask::kSDF_Format;
return FitsInAtlas(glyph) && glyph.maskFormat() == SkMask::kSDF_Format;
}

bool SkStrikeForGPU::CanDrawAsPath(const SkGlyph& glyph) {
SkASSERT(glyph.isColor() || glyph.setPathHasBeenCalled());
return !glyph.isColor() && glyph.path() != nullptr;
}

bool SkStrikeForGPU::FitsInAtlas(const SkGlyph& glyph) {
return glyph.maxDimension() <= SkStrikeCommon::kSkSideTooBigForAtlas;
}

1 change: 1 addition & 0 deletions src/core/SkStrikeForGPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class SkStrikeForGPU {
static bool CanDrawAsMask(const SkGlyph& glyph);
static bool CanDrawAsSDFT(const SkGlyph& glyph);
static bool CanDrawAsPath(const SkGlyph& glyph);
static bool FitsInAtlas(const SkGlyph& glyph);


struct Deleter {
Expand Down

0 comments on commit d0a404e

Please sign in to comment.