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

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

Issue 2265623002: src/utils/SkBitSet: simplify (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-08-19 (Friday) 16:05:19 EDT Created 4 years, 4 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/utils/SkBitSet.cpp ('k') | tests/BitSetTest.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 #include "SkTypes.h" 8 #include "SkTypes.h"
9 #if defined(SK_BUILD_FOR_WIN32) 9 #if defined(SK_BUILD_FOR_WIN32)
10 10
(...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after
2088 , fXpsGlyphs(xpsGlyphs) { } 2088 , fXpsGlyphs(xpsGlyphs) { }
2089 2089
2090 void operator()(const SkGlyph& glyph, SkPoint position, SkPoint) { 2090 void operator()(const SkGlyph& glyph, SkPoint position, SkPoint) {
2091 SkASSERT(glyph.fWidth > 0 && glyph.fHeight > 0); 2091 SkASSERT(glyph.fWidth > 0 && glyph.fHeight > 0);
2092 2092
2093 SkScalar x = position.fX; 2093 SkScalar x = position.fX;
2094 SkScalar y = position.fY; 2094 SkScalar y = position.fY;
2095 2095
2096 XPS_GLYPH_INDEX* xpsGlyph = fXpsGlyphs->append(); 2096 XPS_GLYPH_INDEX* xpsGlyph = fXpsGlyphs->append();
2097 uint16_t glyphID = glyph.getGlyphID(); 2097 uint16_t glyphID = glyph.getGlyphID();
2098 fGlyphUse->setBit(glyphID, true); 2098 fGlyphUse->set(glyphID);
2099 xpsGlyph->index = glyphID; 2099 xpsGlyph->index = glyphID;
2100 if (1 == fXpsGlyphs->count()) { 2100 if (1 == fXpsGlyphs->count()) {
2101 xpsGlyph->advanceWidth = 0.0f; 2101 xpsGlyph->advanceWidth = 0.0f;
2102 xpsGlyph->horizontalOffset = SkScalarToFloat(x) * fCentemPerUnit; 2102 xpsGlyph->horizontalOffset = SkScalarToFloat(x) * fCentemPerUnit;
2103 xpsGlyph->verticalOffset = SkScalarToFloat(y) * -fCentemPerUnit; 2103 xpsGlyph->verticalOffset = SkScalarToFloat(y) * -fCentemPerUnit;
2104 } 2104 }
2105 else { 2105 else {
2106 const XPS_GLYPH_INDEX& first = (*fXpsGlyphs)[0]; 2106 const XPS_GLYPH_INDEX& first = (*fXpsGlyphs)[0];
2107 xpsGlyph->advanceWidth = 0.0f; 2107 xpsGlyph->advanceWidth = 0.0f;
2108 xpsGlyph->horizontalOffset = (SkScalarToFloat(x) * fCentemPerUnit) 2108 xpsGlyph->horizontalOffset = (SkScalarToFloat(x) * fCentemPerUnit)
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2277 //SkXPSDevice* dev = new SkXPSDevice(this); 2277 //SkXPSDevice* dev = new SkXPSDevice(this);
2278 //SkSize s = SkSize::Make(width, height); 2278 //SkSize s = SkSize::Make(width, height);
2279 //dev->BeginCanvas(s, s, SkMatrix::I()); 2279 //dev->BeginCanvas(s, s, SkMatrix::I());
2280 //return dev; 2280 //return dev;
2281 } 2281 }
2282 #endif 2282 #endif
2283 return new SkXPSDevice(this->fXpsFactory.get()); 2283 return new SkXPSDevice(this->fXpsFactory.get());
2284 } 2284 }
2285 2285
2286 #endif//defined(SK_BUILD_FOR_WIN32) 2286 #endif//defined(SK_BUILD_FOR_WIN32)
OLDNEW
« no previous file with comments | « src/utils/SkBitSet.cpp ('k') | tests/BitSetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698