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

Side by Side Diff: src/fonts/SkTestScalerContext.cpp

Issue 1373363007: Force cache SkTestScalerContext path bounds. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | 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 2014 Google Inc. 2 * Copyright 2014 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 #include "SkAdvancedTypefaceMetrics.h" 8 #include "SkAdvancedTypefaceMetrics.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 pts += 6; 101 pts += 6;
102 break; 102 break;
103 case SkPath::kClose_Verb: 103 case SkPath::kClose_Verb:
104 path->close(); 104 path->close();
105 break; 105 break;
106 default: 106 default:
107 SkDEBUGFAIL("bad verb"); 107 SkDEBUGFAIL("bad verb");
108 return; 108 return;
109 } 109 }
110 } 110 }
111 // This should make SkPath::getBounds() queries threadsafe.
112 path->updateBoundsCache();
111 fPaths[index] = path; 113 fPaths[index] = path;
112 } 114 }
113 } 115 }
114 116
115 SkTestTypeface::SkTestTypeface(SkTestFont* testFont, const SkFontStyle& style) 117 SkTestTypeface::SkTestTypeface(SkTestFont* testFont, const SkFontStyle& style)
116 : SkTypeface(style, SkTypefaceCache::NewFontID(), false) 118 : SkTypeface(style, SkTypefaceCache::NewFontID(), false)
117 , fTestFont(testFont) { 119 , fTestFont(testFont) {
118 } 120 }
119 121
120 void SkTestTypeface::getAdvance(SkGlyph* glyph) { 122 void SkTestTypeface::getAdvance(SkGlyph* glyph) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 } 277 }
276 278
277 private: 279 private:
278 SkTestTypeface* fFace; 280 SkTestTypeface* fFace;
279 SkMatrix fMatrix; 281 SkMatrix fMatrix;
280 }; 282 };
281 283
282 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const { 284 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const {
283 return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), desc); 285 return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), desc);
284 } 286 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698