Lines Matching refs:value

265     Entry(ParagraphCacheValue* value) : fValue(value) {}
330 bool ParagraphCache::useCachedLayout(const ParagraphImpl& paragraph, const ParagraphCacheValue* value) {
331 if (value && value->indents == paragraph.fIndents &&
332 paragraph.getLineBreakStrategy() == value->linebreakStrategy &&
333 paragraph.getWordBreakType() == value->wordBreakType &&
334 abs(paragraph.fLayoutRawWidth - value->fLayoutRawWidth) < 1.f &&
335 paragraph.fParagraphStyle.getMaxLines() == value->maxlines &&
336 paragraph.fParagraphStyle.ellipsized() == value->hasEllipsis &&
337 paragraph.fParagraphStyle.getEllipsisMod() == value->ellipsisModal &&
338 paragraph.fText.size() == value->fKey.text().size()) {
350 if (auto value = (*entry)->fValue.get()) {
351 SetStoredLayoutImpl(paragraph, value);
354 if (auto value = cacheLayout(&paragraph)) {
355 SetStoredLayoutImpl(paragraph, value);
360 void ParagraphCache::SetStoredLayoutImpl(ParagraphImpl& paragraph, ParagraphCacheValue* value) {
361 if (paragraph.fRuns.size() == value->fRuns.size()) {
362 // update PlaceholderRun metrics cache value for placeholder alignment
363 for (size_t idx = 0; idx < value->fRuns.size(); ++idx) {
364 if (!value->fRuns[idx].isPlaceholder()) {
367 value->fRuns[idx].fFontMetrics = paragraph.fRuns[idx].fFontMetrics;
368 value->fRuns[idx].fCorrectAscent = paragraph.fRuns[idx].fCorrectAscent;
369 value->fRuns[idx].fCorrectDescent = paragraph.fRuns[idx].fCorrectDescent;
372 value->fLines.reset();
373 value->indents.clear();
376 value->fLines.emplace_back(line.CloneSelf());
378 paragraph.getSize(value->fHeight, value->fWidth, value->fLongestLine);
379 value->fLongestLineWithIndent = paragraph.getLongestLineWithIndent();
380 paragraph.getIntrinsicSize(value->fMaxIntrinsicWidth, value->fMinIntrinsicWidth,
381 value->fAlphabeticBaseline, value->fIdeographicBaseline,
382 value->fExceededMaxLines);
383 for (auto& indent : value->indents) {
384 value->indents.push_back(indent);
386 value->linebreakStrategy = paragraph.getLineBreakStrategy();
387 value->wordBreakType = paragraph.getWordBreakType();
388 value->fLayoutRawWidth = paragraph.fLayoutRawWidth;
389 value->maxlines = paragraph.fParagraphStyle.getMaxLines();
390 value->hasEllipsis = paragraph.fParagraphStyle.ellipsized();
391 value->ellipsisModal = paragraph.fParagraphStyle.getEllipsisMod();
404 ParagraphCacheValue* value = (*entry)->fValue.get();
405 if (!value) {
410 if (!useCachedLayout(paragraph, value)) {
415 if (value->fLines.empty()) {
418 if (paragraph.fRuns.size() == value->fRuns.size()) {
420 for (size_t idx = 0; idx < value->fRuns.size(); ++idx) {
421 if (!value->fRuns[idx].isPlaceholder()) {
424 paragraph.fRuns[idx].fFontMetrics = value->fRuns[idx].fFontMetrics;
425 paragraph.fRuns[idx].fCorrectAscent = value->fRuns[idx].fCorrectAscent;
426 paragraph.fRuns[idx].fCorrectDescent = value->fRuns[idx].fCorrectDescent;
430 for (auto& line : value->fLines) {
434 paragraph.setSize(value->fHeight, value->fWidth, value->fLongestLine);
435 paragraph.setLongestLineWithIndent(value->fLongestLineWithIndent);
436 paragraph.setIntrinsicSize(value->fMaxIntrinsicWidth, value->fMinIntrinsicWidth,
437 value->fAlphabeticBaseline, value->fIdeographicBaseline,
438 value->fExceededMaxLines);
502 ParagraphCacheValue* value = new ParagraphCacheValue(std::move(key), paragraph);
503 fLRUCacheMap.insert(value->fKey, std::make_unique<Entry>(value));
507 fLastCachedValue = value;
510 fLastCachedValue = value;
538 ParagraphCacheValue* value = new ParagraphCacheValue(std::move(key), paragraph);
539 fLRUCacheMap.insert(value->fKey, std::make_unique<Entry>(value));
542 fLastCachedValue = value;
544 return value;