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

Side by Side Diff: src/core/SkPaint.cpp

Issue 1211413003: Make SkPaint::glyphsToUnichars use explicit SkSurfaceProps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 5 years, 5 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 | « include/core/SkPaint.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 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 #include "SkPaint.h" 8 #include "SkPaint.h"
9 #include "SkAnnotation.h" 9 #include "SkAnnotation.h"
10 #include "SkAutoKern.h" 10 #include "SkAutoKern.h"
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 } 512 }
513 break; 513 break;
514 } 514 }
515 default: 515 default:
516 SkDEBUGFAIL("unknown text encoding"); 516 SkDEBUGFAIL("unknown text encoding");
517 return false; 517 return false;
518 } 518 }
519 return true; 519 return true;
520 } 520 }
521 521
522 void SkPaint::glyphsToUnichars(const uint16_t glyphs[], int count, 522 void SkPaint::glyphsToUnichars(const uint16_t glyphs[], int count, SkUnichar tex tData[]) const {
523 SkUnichar textData[]) const {
524 if (count <= 0) { 523 if (count <= 0) {
525 return; 524 return;
526 } 525 }
527 526
528 SkASSERT(glyphs != NULL); 527 SkASSERT(glyphs != NULL);
529 SkASSERT(textData != NULL); 528 SkASSERT(textData != NULL);
530 529
531 SkAutoGlyphCache autoCache(*this, NULL, NULL); 530 SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
531 SkAutoGlyphCache autoCache(*this, &props, NULL);
532 SkGlyphCache* cache = autoCache.getCache(); 532 SkGlyphCache* cache = autoCache.getCache();
533 533
534 for (int index = 0; index < count; index++) { 534 for (int index = 0; index < count; index++) {
535 textData[index] = cache->glyphToUnichar(glyphs[index]); 535 textData[index] = cache->glyphToUnichar(glyphs[index]);
536 } 536 }
537 } 537 }
538 538
539 /////////////////////////////////////////////////////////////////////////////// 539 ///////////////////////////////////////////////////////////////////////////////
540 540
541 static const SkGlyph& sk_getMetrics_utf8_next(SkGlyphCache* cache, 541 static const SkGlyph& sk_getMetrics_utf8_next(SkGlyphCache* cache,
(...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after
2416 } 2416 }
2417 2417
2418 uint32_t SkPaint::getHash() const { 2418 uint32_t SkPaint::getHash() const {
2419 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields, 2419 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields,
2420 // so fBitfields should be 10 pointers and 6 32-bit values from the start. 2420 // so fBitfields should be 10 pointers and 6 32-bit values from the start.
2421 SK_COMPILE_ASSERT(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 * sizeof(uint32_t), 2421 SK_COMPILE_ASSERT(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 * sizeof(uint32_t),
2422 SkPaint_notPackedTightly); 2422 SkPaint_notPackedTightly);
2423 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), 2423 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this),
2424 offsetof(SkPaint, fBitfields) + sizeof(fBitfields )); 2424 offsetof(SkPaint, fBitfields) + sizeof(fBitfields ));
2425 } 2425 }
OLDNEW
« no previous file with comments | « include/core/SkPaint.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698