aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/xps/SkXPSDevice.h
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-03-04 21:47:47 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-04 21:48:01 +0000
commit27d07f0acb85eea4062075dfbe9148ce12d92c66 (patch)
tree7328000f52b82a4c1478ddc79b8d383f2b832bed /src/xps/SkXPSDevice.h
parent5b4599f137ce0966a88d2ba2bdbb6aa72b1ae082 (diff)
Revert "Revert "Revert "Revert[2] "Remove SkDraw from device-draw methods, and enable device-centric clipping."""""
This reverts commit 025e2444c1f5a0c3cdc0bf60d1fa59941a0b5db4. Reason for revert: layouttest failures -- need to rebase these (tiny diffs in gradients) https://storage.googleapis.com/chromium-layout-test-archives/linux_trusty_blink_rel/6018/layout-test-results/results.html Original change's description: > Revert "Revert "Revert[2] "Remove SkDraw from device-draw methods, and enable device-centric clipping."""" > > This reverts commit baf06bc89a0ee2ac4033281e7310f6c727faab79. > > Reason for revert: reland to diagnose possible g3 failure > > Original change's description: > > Revert "Revert[2] "Remove SkDraw from device-draw methods, and enable device-centric clipping.""" > > > > This reverts commit cfaa63237b152ae216f1351207bce3ea9808814c. > > > > Reason for revert: speculative revert to fix Google3 > > > > Original change's description: > > > Revert[2] "Remove SkDraw from device-draw methods, and enable device-centric clipping."" > > > > > > passes new (augmented) CanvasClipType unittest > > > fixed rasterclipstack::setnewsize > > > > > > This reverts commit ea5e676a7b75600edcde3912886486004ccd7626. > > > > > > BUG=skia: > > > > > > Change-Id: I004653e0f4d01454662f8516fccab0046486f273 > > > Reviewed-on: https://skia-review.googlesource.com/9185 > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > Commit-Queue: Mike Reed <reed@google.com> > > > > > > > TBR=bsalomon@google.com,reed@google.com,reviews@skia.org > > NOPRESUBMIT=true > > NOTREECHECKS=true > > NOTRY=true > > BUG=skia: > > > > Change-Id: Ibd7ee6383999f008eb6ee59c1c3f1c06a86044ea > > Reviewed-on: https://skia-review.googlesource.com/9230 > > Reviewed-by: Cary Clark <caryclark@google.com> > > Commit-Queue: Cary Clark <caryclark@google.com> > > > > TBR=bsalomon@google.com,reviews@skia.org,caryclark@google.com,reed@google.com,mtklein@chromium.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Change-Id: I093fa8788056be39af01191bbf3a9e5de9f73954 > Reviewed-on: https://skia-review.googlesource.com/9244 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> > TBR=mtklein@chromium.org,bsalomon@google.com,reviews@skia.org,caryclark@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Change-Id: I58f810a8ff241dbaf3133e2fe844548fcd0fa67a Reviewed-on: https://skia-review.googlesource.com/9245 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/xps/SkXPSDevice.h')
-rw-r--r--src/xps/SkXPSDevice.h120
1 files changed, 82 insertions, 38 deletions
diff --git a/src/xps/SkXPSDevice.h b/src/xps/SkXPSDevice.h
index a03b2932ca..0ad9939509 100644
--- a/src/xps/SkXPSDevice.h
+++ b/src/xps/SkXPSDevice.h
@@ -16,10 +16,9 @@
#include <XpsObjectModel.h>
#include "SkAutoCoInitialize.h"
-#include "SkBitSet.h"
#include "SkBitmapDevice.h"
+#include "SkBitSet.h"
#include "SkCanvas.h"
-#include "SkClipStackDevice.h"
#include "SkColor.h"
#include "SkPaint.h"
#include "SkPath.h"
@@ -36,7 +35,7 @@
The drawing context for the XPS backend.
*/
-class SkXPSDevice : public SkClipStackDevice {
+class SkXPSDevice : public SkBaseDevice {
public:
SK_API SkXPSDevice(SkISize);
SK_API virtual ~SkXPSDevice();
@@ -74,39 +73,79 @@ public:
bool endPortfolio();
protected:
- void drawPaint(const SkPaint& paint) override;
- void drawPoints(SkCanvas::PointMode mode, size_t count,
- const SkPoint[], const SkPaint& paint) override;
- void drawRect(const SkRect& r,
- const SkPaint& paint) override;
- void drawOval(const SkRect& oval,
- const SkPaint& paint) override;
- void drawRRect(const SkRRect& rr,
- const SkPaint& paint) override;
- void drawPath(const SkPath& path,
- const SkPaint& paint,
- const SkMatrix* prePathMatrix = NULL,
- bool pathIsMutable = false) override;
- void drawBitmap(const SkBitmap& bitmap,
- const SkMatrix& matrix, const SkPaint& paint) override;
- void drawSprite(const SkBitmap& bitmap,
- int x, int y, const SkPaint& paint) override;
- void drawBitmapRect(const SkBitmap&,
- const SkRect* srcOrNull, const SkRect& dst,
- const SkPaint& paint,
+ void drawPaint(const SkDraw&, const SkPaint& paint) override;
+
+ void drawPoints(
+ const SkDraw&,
+ SkCanvas::PointMode mode,
+ size_t count, const SkPoint[],
+ const SkPaint& paint) override;
+
+ void drawRect(
+ const SkDraw&,
+ const SkRect& r,
+ const SkPaint& paint) override;
+
+ void drawRRect(
+ const SkDraw&,
+ const SkRRect&,
+ const SkPaint& paint) override;
+
+ void drawPath(
+ const SkDraw&,
+ const SkPath& platonicPath,
+ const SkPaint& paint,
+ const SkMatrix* prePathMatrix,
+ bool pathIsMutable) override;
+
+ void drawBitmap(
+ const SkDraw&,
+ const SkBitmap& bitmap,
+ const SkMatrix& matrix,
+ const SkPaint& paint) override;
+
+ void drawSprite(
+ const SkDraw&,
+ const SkBitmap& bitmap,
+ int x, int y,
+ const SkPaint& paint) override;
+
+ void drawText(
+ const SkDraw&,
+ const void* text, size_t len,
+ SkScalar x, SkScalar y,
+ const SkPaint& paint) override;
+
+ void drawPosText(
+ const SkDraw&,
+ const void* text, size_t len,
+ const SkScalar pos[], int scalarsPerPos,
+ const SkPoint& offset, const SkPaint& paint) override;
+
+ void drawVertices(
+ const SkDraw&,
+ SkCanvas::VertexMode,
+ int vertexCount, const SkPoint verts[],
+ const SkPoint texs[], const SkColor colors[],
+ SkBlendMode,
+ const uint16_t indices[], int indexCount,
+ const SkPaint& paint) override;
+
+ void drawDevice(
+ const SkDraw&,
+ SkBaseDevice* device,
+ int x, int y,
+ const SkPaint& paint) override;
+
+ void drawOval(const SkDraw&, const SkRect&, const SkPaint&) override;
+
+ void drawBitmapRect(const SkDraw&,
+ const SkBitmap&,
+ const SkRect*,
+ const SkRect&,
+ const SkPaint&,
SkCanvas::SrcRectConstraint) override;
- void drawText(const void* text, size_t len,
- SkScalar x, SkScalar y, const SkPaint& paint) override;
- void drawPosText(const void* text, size_t len,
- const SkScalar pos[], int scalarsPerPos,
- const SkPoint& offset, const SkPaint& paint) override;
- void drawVertices(SkCanvas::VertexMode, int vertexCount,
- const SkPoint verts[], const SkPoint texs[],
- const SkColor colors[], SkBlendMode,
- const uint16_t indices[], int indexCount,
- const SkPaint& paint) override;
- void drawDevice(SkBaseDevice*, int x, int y,
- const SkPaint&) override;
+
private:
class TypefaceUse : ::SkNoncopyable {
@@ -159,6 +198,7 @@ private:
IXpsOMImageResource** image);
void internalDrawRect(
+ const SkDraw&,
const SkRect& r,
bool transformRect,
const SkPaint& paint);
@@ -217,6 +257,7 @@ private:
TypefaceUse** fontResource);
HRESULT AddGlyphs(
+ const SkDraw& d,
IXpsOMObjectFactory* xpsFactory,
IXpsOMCanvas* canvas,
TypefaceUse* font,
@@ -248,14 +289,16 @@ private:
const SkColor color,
IXpsOMVisualCollection* visuals);
- HRESULT clip(IXpsOMVisual* xpsVisual);
-
+ HRESULT clip(
+ IXpsOMVisual* xpsVisual,
+ const SkDraw& d);
HRESULT clipToPath(
IXpsOMVisual* xpsVisual,
const SkPath& clipPath,
XPS_FILL_RULE fillRule);
HRESULT drawInverseWindingPath(
+ const SkDraw& d,
const SkPath& devicePath,
IXpsOMPath* xpsPath);
@@ -272,6 +315,7 @@ private:
const SkIRect& clip, SkIRect* clipIRect);
HRESULT applyMask(
+ const SkDraw& d,
const SkMask& mask,
const SkVector& ppuScale,
IXpsOMPath* shadedPath);
@@ -282,7 +326,7 @@ private:
SkXPSDevice(const SkXPSDevice&);
void operator=(const SkXPSDevice&);
- typedef SkClipStackDevice INHERITED;
+ typedef SkBaseDevice INHERITED;
};
#endif // SK_BUILD_FOR_WIN