2009-03-31 03:48:49 +00:00
|
|
|
|
2011-07-28 14:26:00 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2011 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
2009-03-31 03:48:49 +00:00
|
|
|
#ifndef SkNWayCanvas_DEFINED
|
|
|
|
#define SkNWayCanvas_DEFINED
|
|
|
|
|
|
|
|
#include "SkCanvas.h"
|
|
|
|
|
2013-07-15 22:49:37 +00:00
|
|
|
class SK_API SkNWayCanvas : public SkCanvas {
|
2009-03-31 03:48:49 +00:00
|
|
|
public:
|
2012-05-01 16:50:25 +00:00
|
|
|
SkNWayCanvas(int width, int height);
|
2009-03-31 03:48:49 +00:00
|
|
|
virtual ~SkNWayCanvas();
|
2012-01-28 01:45:11 +00:00
|
|
|
|
2009-03-31 03:48:49 +00:00
|
|
|
void addCanvas(SkCanvas*);
|
|
|
|
void removeCanvas(SkCanvas*);
|
|
|
|
void removeAll();
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
// These are forwarded to the N canvases we're referencing
|
|
|
|
|
2011-12-07 14:46:39 +00:00
|
|
|
virtual int save(SaveFlags) SK_OVERRIDE;
|
|
|
|
virtual int saveLayer(const SkRect* bounds, const SkPaint*,
|
|
|
|
SaveFlags) SK_OVERRIDE;
|
|
|
|
virtual void restore() SK_OVERRIDE;
|
|
|
|
virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE;
|
|
|
|
virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE;
|
|
|
|
virtual bool rotate(SkScalar degrees) SK_OVERRIDE;
|
|
|
|
virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE;
|
|
|
|
virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE;
|
|
|
|
virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE;
|
2011-10-12 11:52:53 +00:00
|
|
|
virtual bool clipRect(const SkRect&, SkRegion::Op, bool) SK_OVERRIDE;
|
2012-12-12 20:48:18 +00:00
|
|
|
virtual bool clipRRect(const SkRRect&, SkRegion::Op, bool) SK_OVERRIDE;
|
2011-10-12 11:52:53 +00:00
|
|
|
virtual bool clipPath(const SkPath&, SkRegion::Op, bool) SK_OVERRIDE;
|
2009-03-31 03:48:49 +00:00
|
|
|
virtual bool clipRegion(const SkRegion& deviceRgn,
|
2011-12-07 14:46:39 +00:00
|
|
|
SkRegion::Op) SK_OVERRIDE;
|
2009-03-31 03:48:49 +00:00
|
|
|
|
2011-12-07 14:46:39 +00:00
|
|
|
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
|
2009-03-31 03:48:49 +00:00
|
|
|
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
|
2011-12-07 14:46:39 +00:00
|
|
|
const SkPaint&) SK_OVERRIDE;
|
2012-12-12 20:48:18 +00:00
|
|
|
virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
|
|
|
|
virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
|
|
|
|
virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
|
2011-12-07 14:46:39 +00:00
|
|
|
virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
|
2009-03-31 03:48:49 +00:00
|
|
|
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
|
2011-12-07 14:46:39 +00:00
|
|
|
const SkPaint*) SK_OVERRIDE;
|
2012-09-18 15:14:33 +00:00
|
|
|
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
|
2013-08-16 10:24:37 +00:00
|
|
|
const SkRect& dst, const SkPaint* paint,
|
|
|
|
DrawBitmapRectFlags flags) SK_OVERRIDE;
|
2009-03-31 03:48:49 +00:00
|
|
|
virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m,
|
2011-12-07 14:46:39 +00:00
|
|
|
const SkPaint*) SK_OVERRIDE;
|
2009-03-31 03:48:49 +00:00
|
|
|
virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
|
2011-12-07 14:46:39 +00:00
|
|
|
const SkPaint*) SK_OVERRIDE;
|
2009-03-31 03:48:49 +00:00
|
|
|
virtual void drawText(const void* text, size_t byteLength, SkScalar x,
|
2011-12-07 14:46:39 +00:00
|
|
|
SkScalar y, const SkPaint&) SK_OVERRIDE;
|
2009-03-31 03:48:49 +00:00
|
|
|
virtual void drawPosText(const void* text, size_t byteLength,
|
2011-12-07 14:46:39 +00:00
|
|
|
const SkPoint pos[], const SkPaint&) SK_OVERRIDE;
|
2009-03-31 03:48:49 +00:00
|
|
|
virtual void drawPosTextH(const void* text, size_t byteLength,
|
|
|
|
const SkScalar xpos[], SkScalar constY,
|
2011-12-07 14:46:39 +00:00
|
|
|
const SkPaint&) SK_OVERRIDE;
|
2009-03-31 03:48:49 +00:00
|
|
|
virtual void drawTextOnPath(const void* text, size_t byteLength,
|
|
|
|
const SkPath& path, const SkMatrix* matrix,
|
2011-12-07 14:46:39 +00:00
|
|
|
const SkPaint&) SK_OVERRIDE;
|
|
|
|
virtual void drawPicture(SkPicture&) SK_OVERRIDE;
|
2009-03-31 03:48:49 +00:00
|
|
|
virtual void drawVertices(VertexMode vmode, int vertexCount,
|
|
|
|
const SkPoint vertices[], const SkPoint texs[],
|
|
|
|
const SkColor colors[], SkXfermode* xmode,
|
|
|
|
const uint16_t indices[], int indexCount,
|
2011-12-07 14:46:39 +00:00
|
|
|
const SkPaint&) SK_OVERRIDE;
|
2009-03-31 03:48:49 +00:00
|
|
|
|
2011-12-07 14:46:39 +00:00
|
|
|
virtual SkBounder* setBounder(SkBounder*) SK_OVERRIDE;
|
|
|
|
virtual SkDrawFilter* setDrawFilter(SkDrawFilter*) SK_OVERRIDE;
|
2012-01-28 01:45:11 +00:00
|
|
|
|
2013-07-20 15:03:26 +00:00
|
|
|
virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
|
|
|
|
virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
|
|
|
|
virtual void endCommentGroup() SK_OVERRIDE;
|
|
|
|
|
2009-03-31 03:48:49 +00:00
|
|
|
private:
|
|
|
|
SkTDArray<SkCanvas*> fList;
|
2012-01-28 01:45:11 +00:00
|
|
|
|
2009-03-31 03:48:49 +00:00
|
|
|
class Iter;
|
|
|
|
|
|
|
|
typedef SkCanvas INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|