1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/include/utils/SkNWayCanvas.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,99 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2011 Google Inc. 1.7 + * 1.8 + * Use of this source code is governed by a BSD-style license that can be 1.9 + * found in the LICENSE file. 1.10 + */ 1.11 + 1.12 +#ifndef SkNWayCanvas_DEFINED 1.13 +#define SkNWayCanvas_DEFINED 1.14 + 1.15 +#include "SkCanvas.h" 1.16 + 1.17 +class SK_API SkNWayCanvas : public SkCanvas { 1.18 +public: 1.19 + SkNWayCanvas(int width, int height); 1.20 + virtual ~SkNWayCanvas(); 1.21 + 1.22 + virtual void addCanvas(SkCanvas*); 1.23 + virtual void removeCanvas(SkCanvas*); 1.24 + virtual void removeAll(); 1.25 + 1.26 + /////////////////////////////////////////////////////////////////////////// 1.27 + // These are forwarded to the N canvases we're referencing 1.28 + 1.29 + virtual void clear(SkColor) SK_OVERRIDE; 1.30 + virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; 1.31 + virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], 1.32 + const SkPaint&) SK_OVERRIDE; 1.33 + virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE; 1.34 + virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE; 1.35 + virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; 1.36 + virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE; 1.37 + virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, 1.38 + const SkPaint*) SK_OVERRIDE; 1.39 + virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, 1.40 + const SkRect& dst, const SkPaint* paint, 1.41 + DrawBitmapRectFlags flags) SK_OVERRIDE; 1.42 + virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, 1.43 + const SkPaint*) SK_OVERRIDE; 1.44 + virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, 1.45 + const SkRect& dst, 1.46 + const SkPaint* paint = NULL) SK_OVERRIDE; 1.47 + virtual void drawSprite(const SkBitmap& bitmap, int left, int top, 1.48 + const SkPaint*) SK_OVERRIDE; 1.49 + virtual void drawText(const void* text, size_t byteLength, SkScalar x, 1.50 + SkScalar y, const SkPaint&) SK_OVERRIDE; 1.51 + virtual void drawPosText(const void* text, size_t byteLength, 1.52 + const SkPoint pos[], const SkPaint&) SK_OVERRIDE; 1.53 + virtual void drawPosTextH(const void* text, size_t byteLength, 1.54 + const SkScalar xpos[], SkScalar constY, 1.55 + const SkPaint&) SK_OVERRIDE; 1.56 + virtual void drawTextOnPath(const void* text, size_t byteLength, 1.57 + const SkPath& path, const SkMatrix* matrix, 1.58 + const SkPaint&) SK_OVERRIDE; 1.59 + virtual void drawPicture(SkPicture&) SK_OVERRIDE; 1.60 + virtual void drawVertices(VertexMode vmode, int vertexCount, 1.61 + const SkPoint vertices[], const SkPoint texs[], 1.62 + const SkColor colors[], SkXfermode* xmode, 1.63 + const uint16_t indices[], int indexCount, 1.64 + const SkPaint&) SK_OVERRIDE; 1.65 + virtual void drawData(const void* data, size_t length) SK_OVERRIDE; 1.66 + 1.67 + virtual SkBounder* setBounder(SkBounder*) SK_OVERRIDE; 1.68 + virtual SkDrawFilter* setDrawFilter(SkDrawFilter*) SK_OVERRIDE; 1.69 + 1.70 + virtual void beginCommentGroup(const char* description) SK_OVERRIDE; 1.71 + virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE; 1.72 + virtual void endCommentGroup() SK_OVERRIDE; 1.73 + 1.74 +protected: 1.75 + SkTDArray<SkCanvas*> fList; 1.76 + 1.77 + virtual void willSave(SaveFlags) SK_OVERRIDE; 1.78 + virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE; 1.79 + virtual void willRestore() SK_OVERRIDE; 1.80 + 1.81 + virtual void didTranslate(SkScalar, SkScalar) SK_OVERRIDE; 1.82 + virtual void didScale(SkScalar, SkScalar) SK_OVERRIDE; 1.83 + virtual void didRotate(SkScalar) SK_OVERRIDE; 1.84 + virtual void didSkew(SkScalar, SkScalar) SK_OVERRIDE; 1.85 + virtual void didConcat(const SkMatrix&) SK_OVERRIDE; 1.86 + virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE; 1.87 + 1.88 + virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE; 1.89 + 1.90 + virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE; 1.91 + virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE; 1.92 + virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE; 1.93 + virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; 1.94 + 1.95 + class Iter; 1.96 + 1.97 +private: 1.98 + typedef SkCanvas INHERITED; 1.99 +}; 1.100 + 1.101 + 1.102 +#endif