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

Side by Side Diff: Source/platform/text/TextRun.h

Issue 645363003: Consolidate most simple vs. complex Font methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: minor cleanup Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/graphics/GraphicsContext.cpp ('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 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2006, 2007, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2006, 2007, 2011 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
11 * 11 *
12 * This library is distributed in the hope that it will be useful, 12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details. 15 * Library General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Library General Public License 17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to 18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA. 20 * Boston, MA 02110-1301, USA.
21 * 21 *
22 */ 22 */
23 23
24 #ifndef TextRun_h 24 #ifndef TextRun_h
25 #define TextRun_h 25 #define TextRun_h
26 26
27 #include "platform/PlatformExport.h" 27 #include "platform/PlatformExport.h"
28 #include "platform/fonts/Glyph.h" 28 #include "platform/fonts/Glyph.h"
29 #include "platform/geometry/FloatRect.h" 29 #include "platform/geometry/FloatRect.h"
30 #include "platform/heap/Heap.h"
30 #include "platform/text/TextDirection.h" 31 #include "platform/text/TextDirection.h"
31 #include "platform/text/TextPath.h" 32 #include "platform/text/TextPath.h"
32 #include "wtf/RefCounted.h" 33 #include "wtf/RefCounted.h"
33 #include "wtf/text/WTFString.h" 34 #include "wtf/text/WTFString.h"
34 35
36 class SkTextBlob;
37
35 namespace blink { 38 namespace blink {
36 39
37 class FloatPoint; 40 class FloatPoint;
38 class Font; 41 class Font;
39 class GraphicsContext; 42 class GraphicsContext;
40 class GlyphBuffer; 43 class GlyphBuffer;
41 class SimpleFontData; 44 class SimpleFontData;
42 struct GlyphData; 45 struct GlyphData;
43 struct SimpleShaper; 46 struct SimpleShaper;
44 47
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 }; 253 };
251 254
252 inline void TextRun::setTabSize(bool allow, unsigned size) 255 inline void TextRun::setTabSize(bool allow, unsigned size)
253 { 256 {
254 m_allowTabs = allow; 257 m_allowTabs = allow;
255 m_tabSize = size; 258 m_tabSize = size;
256 } 259 }
257 260
258 // Container for parameters needed to paint TextRun. 261 // Container for parameters needed to paint TextRun.
259 struct TextRunPaintInfo { 262 struct TextRunPaintInfo {
263 STACK_ALLOCATED();
264 public:
260 explicit TextRunPaintInfo(const TextRun& r) 265 explicit TextRunPaintInfo(const TextRun& r)
261 : run(r) 266 : run(r)
262 , from(0) 267 , from(0)
263 , to(r.length()) 268 , to(r.length())
269 , cachedTextBlob(nullptr)
264 { 270 {
265 } 271 }
266 272
267 const TextRun& run; 273 const TextRun& run;
268 int from; 274 int from;
269 int to; 275 int to;
270 FloatRect bounds; 276 FloatRect bounds;
277 RefPtr<const SkTextBlob>* cachedTextBlob;
271 }; 278 };
272 279
273 } 280 }
274 #endif 281 #endif
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698