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

Side by Side Diff: src/device/xps/SkXPSDevice.cpp

Issue 85653004: Move distance field font code into SkGpuDevice (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Clean up formatting and address nits Created 7 years 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 | « src/core/SkDrawProcs.h ('k') | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | 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 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef UNICODE 8 #ifndef UNICODE
9 #define UNICODE 9 #define UNICODE
10 #endif 10 #endif
(...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after
2235 xpsGlyph->verticalOffset = (SkFixedToFloat(y) * -procs->centemPerUnit) 2235 xpsGlyph->verticalOffset = (SkFixedToFloat(y) * -procs->centemPerUnit)
2236 - first.verticalOffset; 2236 - first.verticalOffset;
2237 } 2237 }
2238 } 2238 }
2239 2239
2240 static void text_draw_init(const SkPaint& paint, 2240 static void text_draw_init(const SkPaint& paint,
2241 const void* text, size_t byteLength, 2241 const void* text, size_t byteLength,
2242 SkBitSet& glyphsUsed, 2242 SkBitSet& glyphsUsed,
2243 SkDraw& myDraw, SkXPSDrawProcs& procs) { 2243 SkDraw& myDraw, SkXPSDrawProcs& procs) {
2244 procs.fD1GProc = xps_draw_1_glyph; 2244 procs.fD1GProc = xps_draw_1_glyph;
2245 #if SK_DISTANCEFIELD_FONTS
2246 procs.fFlags = 0;
2247 #endif
2248 size_t numGlyphGuess; 2245 size_t numGlyphGuess;
2249 switch (paint.getTextEncoding()) { 2246 switch (paint.getTextEncoding()) {
2250 case SkPaint::kUTF8_TextEncoding: 2247 case SkPaint::kUTF8_TextEncoding:
2251 numGlyphGuess = SkUTF8_CountUnichars( 2248 numGlyphGuess = SkUTF8_CountUnichars(
2252 static_cast<const char *>(text), 2249 static_cast<const char *>(text),
2253 byteLength); 2250 byteLength);
2254 break; 2251 break;
2255 case SkPaint::kUTF16_TextEncoding: 2252 case SkPaint::kUTF16_TextEncoding:
2256 numGlyphGuess = SkUTF16_CountUnichars( 2253 numGlyphGuess = SkUTF16_CountUnichars(
2257 static_cast<const uint16_t *>(text), 2254 static_cast<const uint16_t *>(text),
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
2452 IID_PPV_ARGS(&this->fXpsFactory)), 2449 IID_PPV_ARGS(&this->fXpsFactory)),
2453 "Could not create factory for layer."); 2450 "Could not create factory for layer.");
2454 2451
2455 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), 2452 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas),
2456 "Could not create canvas for layer."); 2453 "Could not create canvas for layer.");
2457 } 2454 }
2458 2455
2459 bool SkXPSDevice::allowImageFilter(SkImageFilter*) { 2456 bool SkXPSDevice::allowImageFilter(SkImageFilter*) {
2460 return false; 2457 return false;
2461 } 2458 }
OLDNEW
« no previous file with comments | « src/core/SkDrawProcs.h ('k') | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698