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
|
|
|
|
2013-09-04 17:16:00 +00:00
|
|
|
virtual void addCanvas(SkCanvas*);
|
|
|
|
virtual void removeCanvas(SkCanvas*);
|
|
|
|
virtual void removeAll();
|
2009-03-31 03:48:49 +00:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
// These are forwarded to the N canvases we're referencing
|
|
|
|
|
2013-11-14 19:02:41 +00:00
|
|
|
virtual void clear(SkColor) SK_OVERRIDE;
|
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;
|
2013-10-22 16:54:15 +00:00
|
|
|
virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
|
2013-11-14 19:02:41 +00:00
|
|
|
virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
|
2012-12-12 20:48:18 +00:00
|
|
|
virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
|
2013-10-22 16:54:15 +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;
|
2013-11-14 19:02:41 +00:00
|
|
|
virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
|
|
|
|
const SkRect& dst,
|
|
|
|
const SkPaint* paint = NULL) 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;
|
|
|
|
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;
|
2013-11-14 19:02:41 +00:00
|
|
|
virtual void drawData(const void* data, size_t length) 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;
|
|
|
|
|
2013-09-04 17:16:00 +00:00
|
|
|
protected:
|
2009-03-31 03:48:49 +00:00
|
|
|
SkTDArray<SkCanvas*> fList;
|
2012-01-28 01:45:11 +00:00
|
|
|
|
2014-03-12 20:21:48 +00:00
|
|
|
virtual void willSave(SaveFlags) SK_OVERRIDE;
|
|
|
|
virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE;
|
|
|
|
virtual void willRestore() SK_OVERRIDE;
|
|
|
|
|
2014-03-13 20:03:58 +00:00
|
|
|
virtual void didConcat(const SkMatrix&) SK_OVERRIDE;
|
|
|
|
virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
|
|
|
|
|
2014-02-21 12:20:45 +00:00
|
|
|
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
|
2014-04-23 04:00:17 +00:00
|
|
|
virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
|
|
|
const SkPaint&) SK_OVERRIDE;
|
|
|
|
virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
|
|
|
const SkPaint&) SK_OVERRIDE;
|
|
|
|
virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
|
|
|
|
SkScalar constY, const SkPaint&) SK_OVERRIDE;
|
|
|
|
virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
|
|
|
const SkMatrix* matrix, const SkPaint&) SK_OVERRIDE;
|
2014-02-21 12:20:45 +00:00
|
|
|
|
2014-02-28 18:19:39 +00:00
|
|
|
virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
|
|
|
|
virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
|
|
|
|
virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
|
|
|
|
virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
|
|
|
|
|
2009-03-31 03:48:49 +00:00
|
|
|
class Iter;
|
|
|
|
|
2013-09-04 17:16:00 +00:00
|
|
|
private:
|
2009-03-31 03:48:49 +00:00
|
|
|
typedef SkCanvas INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|