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

Side by Side Diff: ui/gfx/render_text.h

Issue 435583003: RenderTextHarfBuzz: Check CreateSkiaTypeface return value against NULL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 6 years, 4 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 | « no previous file | ui/gfx/render_text_harfbuzz.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef UI_GFX_RENDER_TEXT_H_ 5 #ifndef UI_GFX_RENDER_TEXT_H_
6 #define UI_GFX_RENDER_TEXT_H_ 6 #define UI_GFX_RENDER_TEXT_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <cstring> 9 #include <cstring>
10 #include <string> 10 #include <string>
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 Size size; 168 Size size;
169 169
170 // Sum of preceding lines' heights. 170 // Sum of preceding lines' heights.
171 int preceding_heights; 171 int preceding_heights;
172 172
173 // Maximum baseline of all segments on this line. 173 // Maximum baseline of all segments on this line.
174 int baseline; 174 int baseline;
175 }; 175 };
176 176
177 // Creates an SkTypeface from a font |family| name and a |gfx::Font::FontStyle|. 177 // Creates an SkTypeface from a font |family| name and a |gfx::Font::FontStyle|.
178 // May return NULL.
178 skia::RefPtr<SkTypeface> CreateSkiaTypeface(const std::string& family, 179 skia::RefPtr<SkTypeface> CreateSkiaTypeface(const std::string& family,
179 int style); 180 int style);
180 181
181 } // namespace internal 182 } // namespace internal
182 183
183 // RenderText represents an abstract model of styled text and its corresponding 184 // RenderText represents an abstract model of styled text and its corresponding
184 // visual layout. Support is built in for a cursor, a selection, simple styling, 185 // visual layout. Support is built in for a cursor, a selection, simple styling,
185 // complex scripts, and bi-directional text. Implementations provide mechanisms 186 // complex scripts, and bi-directional text. Implementations provide mechanisms
186 // for rendering and translation between logical and visual data. 187 // for rendering and translation between logical and visual data.
187 class GFX_EXPORT RenderText { 188 class GFX_EXPORT RenderText {
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 // Lines computed by EnsureLayout. These should be invalidated with 721 // Lines computed by EnsureLayout. These should be invalidated with
721 // ResetLayout and on |display_rect_| changes. 722 // ResetLayout and on |display_rect_| changes.
722 std::vector<internal::Line> lines_; 723 std::vector<internal::Line> lines_;
723 724
724 DISALLOW_COPY_AND_ASSIGN(RenderText); 725 DISALLOW_COPY_AND_ASSIGN(RenderText);
725 }; 726 };
726 727
727 } // namespace gfx 728 } // namespace gfx
728 729
729 #endif // UI_GFX_RENDER_TEXT_H_ 730 #endif // UI_GFX_RENDER_TEXT_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/render_text_harfbuzz.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698