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

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

Issue 147053003: fix (some) 64bit warnings -- size_t -> int (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 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 | « src/core/SkFontDescriptor.cpp ('k') | src/core/SkLineClipper.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkGlyphCache.h" 10 #include "SkGlyphCache.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 return cache; 553 return cache;
554 } 554 }
555 555
556 size_t SkGlyphCache_Globals::internalPurge(size_t minBytesNeeded) { 556 size_t SkGlyphCache_Globals::internalPurge(size_t minBytesNeeded) {
557 this->validate(); 557 this->validate();
558 558
559 size_t bytesNeeded = 0; 559 size_t bytesNeeded = 0;
560 if (fTotalMemoryUsed > fCacheSizeLimit) { 560 if (fTotalMemoryUsed > fCacheSizeLimit) {
561 bytesNeeded = fTotalMemoryUsed - fCacheSizeLimit; 561 bytesNeeded = fTotalMemoryUsed - fCacheSizeLimit;
562 } 562 }
563 bytesNeeded = SkMax32(bytesNeeded, minBytesNeeded); 563 bytesNeeded = SkTMax(bytesNeeded, minBytesNeeded);
564 if (bytesNeeded) { 564 if (bytesNeeded) {
565 // no small purges! 565 // no small purges!
566 bytesNeeded = SkMax32(bytesNeeded, fTotalMemoryUsed >> 2); 566 bytesNeeded = SkTMax(bytesNeeded, fTotalMemoryUsed >> 2);
567 } 567 }
568 568
569 int countNeeded = 0; 569 int countNeeded = 0;
570 if (fCacheCount > fCacheCountLimit) { 570 if (fCacheCount > fCacheCountLimit) {
571 countNeeded = fCacheCount - fCacheCountLimit; 571 countNeeded = fCacheCount - fCacheCountLimit;
572 // no small purges! 572 // no small purges!
573 countNeeded = SkMax32(countNeeded, fCacheCount >> 2); 573 countNeeded = SkMax32(countNeeded, fCacheCount >> 2);
574 } 574 }
575 575
576 // early exit 576 // early exit
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 return tls ? tls->getCacheSizeLimit() : 0; 709 return tls ? tls->getCacheSizeLimit() : 0;
710 } 710 }
711 711
712 void SkGraphics::SetTLSFontCacheLimit(size_t bytes) { 712 void SkGraphics::SetTLSFontCacheLimit(size_t bytes) {
713 if (0 == bytes) { 713 if (0 == bytes) {
714 SkGlyphCache_Globals::DeleteTLS(); 714 SkGlyphCache_Globals::DeleteTLS();
715 } else { 715 } else {
716 SkGlyphCache_Globals::GetTLS().setCacheSizeLimit(bytes); 716 SkGlyphCache_Globals::GetTLS().setCacheSizeLimit(bytes);
717 } 717 }
718 } 718 }
OLDNEW
« no previous file with comments | « src/core/SkFontDescriptor.cpp ('k') | src/core/SkLineClipper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698