1 /* 2 * Copyright 2019 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 9 10 #include "src/core/SkStrikeForGPU.h" 11 12 #include "src/core/SkGlyphRunPainter.h" 13 CanDrawAsMask(const SkGlyph & glyph)14bool SkStrikeForGPU::CanDrawAsMask(const SkGlyph& glyph) { 15 return glyph.maxDimension() <= SkStrikeCommon::kSkSideTooBigForAtlas; 16 } 17 CanDrawAsSDFT(const SkGlyph & glyph)18bool SkStrikeForGPU::CanDrawAsSDFT(const SkGlyph& glyph) { 19 return glyph.maxDimension() <= SkStrikeCommon::kSkSideTooBigForAtlas 20 && glyph.maskFormat() == SkMask::kSDF_Format; 21 } 22 CanDrawAsPath(const SkGlyph & glyph)23bool SkStrikeForGPU::CanDrawAsPath(const SkGlyph& glyph) { 24 SkASSERT(glyph.isColor() || glyph.setPathHasBeenCalled()); 25 return !glyph.isColor() && glyph.path() != nullptr; 26 } 27 28