Add SkPDFDeviceFlatenner which extends SkPDFDevice to add support to flatten the path and the text when we have perspective.
prepare to deprecate SkPDFDevice constructor, and route gm and render_pdfs to use SkDocument::Create pdf interface instead. - controlled by a flag
add comments where we are supposed to flatten other features (paint, shaders, ... )
R=reed@google.com, bungeman@google.com, scroggo@google.com, vandebo@chromium.org, bsalomon@google.com
Author: edisonn@google.com
Review URL: https://codereview.chromium.org/24811002
git-svn-id: http://skia.googlecode.com/svn/trunk/include@11751 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/core/SkDraw.h b/core/SkDraw.h
index 1c2c66e..772e11e 100644
--- a/core/SkDraw.h
+++ b/core/SkDraw.h
@@ -97,16 +97,16 @@
static RectType ComputeRectType(const SkPaint&, const SkMatrix&,
SkPoint* strokeSize);
-private:
void drawText_asPaths(const char text[], size_t byteLength,
SkScalar x, SkScalar y, const SkPaint&) const;
- void drawDevMask(const SkMask& mask, const SkPaint&) const;
- void drawBitmapAsMask(const SkBitmap&, const SkPaint&) const;
-
void drawPosText_asPaths(const char text[], size_t byteLength,
const SkScalar pos[], SkScalar constY,
int scalarsPerPosition, const SkPaint&) const;
+private:
+ void drawDevMask(const SkMask& mask, const SkPaint&) const;
+ void drawBitmapAsMask(const SkBitmap&, const SkPaint&) const;
+
/**
* Return the current clip bounds, in local coordinates, with slop to account
* for antialiasing or hairlines (i.e. device-bounds outset by 1, and then
diff --git a/pdf/SkPDFDevice.h b/pdf/SkPDFDevice.h
index 30ec2dc..d668be5 100644
--- a/pdf/SkPDFDevice.h
+++ b/pdf/SkPDFDevice.h
@@ -11,6 +11,7 @@
#define SkPDFDevice_DEFINED
#include "SkBitmapDevice.h"
+#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkPath.h"
@@ -63,7 +64,7 @@
* inverse scale+translate to accommodate the one that SkPDFDevice
* always does.
*/
- // TODO(vandebo): The sizes should be SkSize and not SkISize.
+ // Deprecated, please use SkDocument::CreatePdf() instead.
SK_API SkPDFDevice(const SkISize& pageSize, const SkISize& contentSize,
const SkMatrix& initialTransform);
SK_API virtual ~SkPDFDevice();
@@ -311,6 +312,11 @@
const SkMatrix& matrix);
typedef SkBitmapDevice INHERITED;
+
+ // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to create
+ // an SkPDFDevice
+ //friend class SkDocument_PDF;
+ //friend class SkPDFImageShader;
};
#endif