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

Side by Side Diff: src/gpu/GrPathRendering.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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 | « src/gpu/GrPathRendererChain.cpp ('k') | src/gpu/GrPipeline.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 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 "GrPathRendering.h" 8 #include "GrPathRendering.h"
9 #include "SkDescriptor.h" 9 #include "SkDescriptor.h"
10 #include "SkGlyph.h" 10 #include "SkGlyph.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 GrPathRange* GrPathRendering::createGlyphs(const SkTypeface* typeface, 57 GrPathRange* GrPathRendering::createGlyphs(const SkTypeface* typeface,
58 const SkDescriptor* desc, 58 const SkDescriptor* desc,
59 const GrStrokeInfo& stroke) { 59 const GrStrokeInfo& stroke) {
60 if (NULL == typeface) { 60 if (NULL == typeface) {
61 typeface = SkTypeface::GetDefaultTypeface(); 61 typeface = SkTypeface::GetDefaultTypeface();
62 SkASSERT(NULL != typeface); 62 SkASSERT(NULL != typeface);
63 } 63 }
64 64
65 if (desc) { 65 if (desc) {
66 SkAutoTUnref<GlyphGenerator> generator(SkNEW_ARGS(GlyphGenerator, (*type face, *desc))); 66 SkAutoTUnref<GlyphGenerator> generator(new GlyphGenerator(*typeface, *de sc));
67 return this->createPathRange(generator, stroke); 67 return this->createPathRange(generator, stroke);
68 } 68 }
69 69
70 SkScalerContextRec rec; 70 SkScalerContextRec rec;
71 memset(&rec, 0, sizeof(rec)); 71 memset(&rec, 0, sizeof(rec));
72 rec.fFontID = typeface->uniqueID(); 72 rec.fFontID = typeface->uniqueID();
73 rec.fTextSize = SkPaint::kCanonicalTextSizeForPaths; 73 rec.fTextSize = SkPaint::kCanonicalTextSizeForPaths;
74 rec.fPreScaleX = rec.fPost2x2[0][0] = rec.fPost2x2[1][1] = SK_Scalar1; 74 rec.fPreScaleX = rec.fPost2x2[0][0] = rec.fPost2x2[1][1] = SK_Scalar1;
75 // Don't bake stroke information into the glyphs, we'll let the GPU do the s troking. 75 // Don't bake stroke information into the glyphs, we'll let the GPU do the s troking.
76 76
77 SkAutoDescriptor ad(sizeof(rec) + SkDescriptor::ComputeOverhead(1)); 77 SkAutoDescriptor ad(sizeof(rec) + SkDescriptor::ComputeOverhead(1));
78 SkDescriptor* genericDesc = ad.getDesc(); 78 SkDescriptor* genericDesc = ad.getDesc();
79 79
80 genericDesc->init(); 80 genericDesc->init();
81 genericDesc->addEntry(kRec_SkDescriptorTag, sizeof(rec), &rec); 81 genericDesc->addEntry(kRec_SkDescriptorTag, sizeof(rec), &rec);
82 genericDesc->computeChecksum(); 82 genericDesc->computeChecksum();
83 83
84 SkAutoTUnref<GlyphGenerator> generator(SkNEW_ARGS(GlyphGenerator, (*typeface , *genericDesc))); 84 SkAutoTUnref<GlyphGenerator> generator(new GlyphGenerator(*typeface, *generi cDesc));
85 return this->createPathRange(generator, stroke); 85 return this->createPathRange(generator, stroke);
86 } 86 }
OLDNEW
« no previous file with comments | « src/gpu/GrPathRendererChain.cpp ('k') | src/gpu/GrPipeline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698