OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrStencilAndCoverTextContext.h" | 8 #include "GrStencilAndCoverTextContext.h" |
9 #include "GrAtlasTextContext.h" | 9 #include "GrAtlasTextContext.h" |
10 #include "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 fCpuMemorySize += run->computeSizeInCache(); | 322 fCpuMemorySize += run->computeSizeInCache(); |
323 } | 323 } |
324 } | 324 } |
325 | 325 |
326 ////////////////////////////////////////////////////////////////////////////////
//////////////////// | 326 ////////////////////////////////////////////////////////////////////////////////
//////////////////// |
327 | 327 |
328 class GrStencilAndCoverTextContext::FallbackBlobBuilder { | 328 class GrStencilAndCoverTextContext::FallbackBlobBuilder { |
329 public: | 329 public: |
330 FallbackBlobBuilder() : fBuffIdx(0), fCount(0) {} | 330 FallbackBlobBuilder() : fBuffIdx(0), fCount(0) {} |
331 | 331 |
332 bool isInitialized() const { return SkToBool(fBuilder); } | 332 bool isInitialized() const { return fBuilder != nullptr; } |
333 | 333 |
334 void init(const SkPaint& font, SkScalar textRatio); | 334 void init(const SkPaint& font, SkScalar textRatio); |
335 | 335 |
336 void appendGlyph(uint16_t glyphId, const SkPoint& pos); | 336 void appendGlyph(uint16_t glyphId, const SkPoint& pos); |
337 | 337 |
338 const SkTextBlob* buildIfNeeded(int* count); | 338 const SkTextBlob* buildIfNeeded(int* count); |
339 | 339 |
340 private: | 340 private: |
341 enum { kWriteBufferSize = 1024 }; | 341 enum { kWriteBufferSize = 1024 }; |
342 | 342 |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 } | 704 } |
705 | 705 |
706 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed
ed(int *count) { | 706 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed
ed(int *count) { |
707 *count = fCount; | 707 *count = fCount; |
708 if (fCount) { | 708 if (fCount) { |
709 this->flush(); | 709 this->flush(); |
710 return fBuilder->build(); | 710 return fBuilder->build(); |
711 } | 711 } |
712 return nullptr; | 712 return nullptr; |
713 } | 713 } |
OLD | NEW |