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

Side by Side Diff: Source/core/platform/graphics/chromium/UniscribeHelper.h

Issue 14160005: Track the region where text is painted. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed build on win and mac Created 7 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2006, 2007, 2008, 2009, Google Inc. All rights reserved. 2 * Copyright (c) 2006, 2007, 2008, 2009, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 26 matching lines...) Expand all
37 #include <usp10.h> 37 #include <usp10.h>
38 #include <map> 38 #include <map>
39 39
40 #include <unicode/uchar.h> 40 #include <unicode/uchar.h>
41 #include <wtf/Vector.h> 41 #include <wtf/Vector.h>
42 42
43 class UniscribeTest_TooBig_Test; // A gunit test for UniscribeHelper. 43 class UniscribeTest_TooBig_Test; // A gunit test for UniscribeHelper.
44 44
45 namespace WebCore { 45 namespace WebCore {
46 46
47 class FloatRect;
47 class FontFeatureSettings; 48 class FontFeatureSettings;
48 class GraphicsContext; 49 class GraphicsContext;
49 50
50 const unsigned cUniscribeHelperStackRuns = 8; 51 const unsigned cUniscribeHelperStackRuns = 8;
51 const unsigned cUniscribeHelperStackChars = 32; 52 const unsigned cUniscribeHelperStackChars = 32;
52 const unsigned cUniscribeHelperFeatures = 4; 53 const unsigned cUniscribeHelperFeatures = 4;
53 54
54 // This object should be safe to create & destroy frequently, as long as the 55 // This object should be safe to create & destroy frequently, as long as the
55 // caller preserves the script_cache when possible (this data may be slow to 56 // caller preserves the script_cache when possible (this data may be slow to
56 // compute). 57 // compute).
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // Converts the given pixel X position into a logical character offset into 190 // Converts the given pixel X position into a logical character offset into
190 // the run. For positions appearing before the first character, this will 191 // the run. For positions appearing before the first character, this will
191 // return -1. 192 // return -1.
192 int xToCharacter(int x) const; 193 int xToCharacter(int x) const;
193 194
194 // Draws the given characters to (x, y) in the given DC. The font will be 195 // Draws the given characters to (x, y) in the given DC. The font will be
195 // handled by this function, but the font color and other attributes should 196 // handled by this function, but the font color and other attributes should
196 // be pre-set. 197 // be pre-set.
197 // 198 //
198 // The y position is the upper left corner, NOT the baseline. 199 // The y position is the upper left corner, NOT the baseline.
199 void draw(GraphicsContext* graphicsContext, HDC dc, int x, int y, int from, 200 void draw(GraphicsContext* graphicsContext, HDC dc,
200 int to); 201 int x, int y,
202 const FloatRect& textRect,
203 int from, int to);
201 204
202 // Returns the first glyph assigned to the character at the given offset. 205 // Returns the first glyph assigned to the character at the given offset.
203 // This function is used to retrieve glyph information when Uniscribe is 206 // This function is used to retrieve glyph information when Uniscribe is
204 // being used to generate glyphs for non-complex, non-BMP (above U+FFFF) 207 // being used to generate glyphs for non-complex, non-BMP (above U+FFFF)
205 // characters. These characters are not otherwise special and have no 208 // characters. These characters are not otherwise special and have no
206 // complex shaping rules, so we don't otherwise need Uniscribe, except 209 // complex shaping rules, so we don't otherwise need Uniscribe, except
207 // Uniscribe is the only way to get glyphs for non-BMP characters. 210 // Uniscribe is the only way to get glyphs for non-BMP characters.
208 // 211 //
209 // Returns 0 if there is no glyph for the given character. 212 // Returns 0 if there is no glyph for the given character.
210 WORD firstGlyphForCharacter(int charOffset) const; 213 WORD firstGlyphForCharacter(int charOffset) const;
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 435
433 // This contains Uniscribe's OpenType feature settings. This structure 436 // This contains Uniscribe's OpenType feature settings. This structure
434 // is filled by using WebKit's |FontFeatureSettings|. 437 // is filled by using WebKit's |FontFeatureSettings|.
435 TEXTRANGE_PROPERTIES m_rangeProperties; 438 TEXTRANGE_PROPERTIES m_rangeProperties;
436 Vector<OPENTYPE_FEATURE_RECORD, cUniscribeHelperFeatures> m_featureRecords; 439 Vector<OPENTYPE_FEATURE_RECORD, cUniscribeHelperFeatures> m_featureRecords;
437 }; 440 };
438 441
439 } // namespace WebCore 442 } // namespace WebCore
440 443
441 #endif // UniscribeHelper_h 444 #endif // UniscribeHelper_h
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/chromium/FontChromiumWin.cpp ('k') | Source/core/platform/graphics/chromium/UniscribeHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698