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

Unified Diff: src/device/xps/SkXPSDevice.cpp

Issue 963953002: XPS, DM: add SkDocument::CreateXPS (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix iOS compile Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/device/xps/SkXPSDevice.h ('k') | src/doc/SkDocument_XPS.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/device/xps/SkXPSDevice.cpp
diff --git a/src/device/xps/SkXPSDevice.cpp b/src/device/xps/SkXPSDevice.cpp
index c1105a2e94c034eb6b0dac5aee6bc20ad5fa5d4b..3bb87b32a3335af86bd00009de9e670373c99e53 100644
--- a/src/device/xps/SkXPSDevice.cpp
+++ b/src/device/xps/SkXPSDevice.cpp
@@ -5,13 +5,14 @@
* found in the LICENSE file.
*/
+#include "SkTypes.h"
+
#ifndef UNICODE
#define UNICODE
#endif
#ifndef _UNICODE
#define _UNICODE
#endif
-#include "SkTypes.h"
#include <ObjBase.h>
#include <XpsObjectModel.h>
#include <T2EmbApi.h>
@@ -23,6 +24,7 @@
#include "SkDraw.h"
#include "SkDrawProcs.h"
#include "SkEndian.h"
+#include "SkGeometry.h"
#include "SkGlyphCache.h"
#include "SkHRESULT.h"
#include "SkImageEncoder.h"
@@ -1363,6 +1365,21 @@ HRESULT SkXPSDevice::addXpsPathGeometry(
segmentData.push(SkScalarToFLOAT(points[3].fX));
segmentData.push(SkScalarToFLOAT(points[3].fY));
break;
+ case SkPath::kConic_Verb: {
+ const SkScalar tol = SK_Scalar1 / 4;
+ SkAutoConicToQuads converter;
+ const SkPoint* quads =
+ converter.computeQuads(points, iter.conicWeight(), tol);
+ for (int i = 0; i < converter.countQuads(); ++i) {
+ segmentTypes.push(XPS_SEGMENT_TYPE_QUADRATIC_BEZIER);
+ segmentStrokes.push(stroke);
+ segmentData.push(SkScalarToFLOAT(quads[2 * i + 1].fX));
+ segmentData.push(SkScalarToFLOAT(quads[2 * i + 1].fY));
+ segmentData.push(SkScalarToFLOAT(quads[2 * i + 2].fX));
+ segmentData.push(SkScalarToFLOAT(quads[2 * i + 2].fY));
+ }
+ break;
+ }
case SkPath::kClose_Verb:
// we ignore these, and just get the whole segment from
// the corresponding line/quad/cubic verbs
@@ -2207,13 +2224,6 @@ void SkXPSDevice::drawPosText(const SkDraw& d,
paint));
}
-void SkXPSDevice::drawTextOnPath(const SkDraw& d, const void* text, size_t len,
- const SkPath& path, const SkMatrix* matrix,
- const SkPaint& paint) {
- //This will call back into the device to do the drawing.
- d.drawTextOnPath((const char*)text, len, path, matrix, paint);
-}
-
void SkXPSDevice::drawDevice(const SkDraw& d, SkBaseDevice* dev,
int x, int y,
const SkPaint&) {
« no previous file with comments | « include/device/xps/SkXPSDevice.h ('k') | src/doc/SkDocument_XPS.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698