Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(858)

Side by Side Diff: third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBuffer.cpp

Issue 2718043003: Refactor InspectorCSSAgent to avoid an intermediate GlyphBuffer (Closed)
Patch Set: cleanup Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBuffer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/fonts/shaping/ShapeResultBuffer.h" 5 #include "platform/fonts/shaping/ShapeResultBuffer.h"
6 6
7 #include "platform/fonts/CharacterRange.h" 7 #include "platform/fonts/CharacterRange.h"
8 #include "platform/fonts/GlyphBuffer.h" 8 #include "platform/fonts/GlyphBuffer.h"
9 #include "platform/fonts/SimpleFontData.h" 9 #include "platform/fonts/SimpleFontData.h"
10 #include "platform/fonts/shaping/ShapeResultInlineHeaders.h" 10 #include "platform/fonts/shaping/ShapeResultInlineHeaders.h"
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 ASSERT(offsetForWord >= 0); 481 ASSERT(offsetForWord >= 0);
482 totalOffset += offsetForWord; 482 totalOffset += offsetForWord;
483 if (targetX >= 0 && targetX <= wordResult->width()) 483 if (targetX >= 0 && targetX <= wordResult->width())
484 return totalOffset; 484 return totalOffset;
485 targetX -= wordResult->width(); 485 targetX -= wordResult->width();
486 } 486 }
487 } 487 }
488 return totalOffset; 488 return totalOffset;
489 } 489 }
490 490
491 Vector<ShapeResultBuffer::RunFontData>
492 ShapeResultBuffer::runFontData() const {
493 Vector<RunFontData> fontData;
494
495 for (const auto& result : m_results) {
496 for (const auto& run : result->m_runs) {
497 fontData.push_back(RunFontData({run->m_fontData.get(),
498 run->m_glyphData.size()}));
499 }
500 }
501 return fontData;
502 }
503
491 } // namespace blink 504 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698