Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: src/pipe/SkPipeCanvas.h

Issue 2201323003: add pipecanvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: initial reader Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1
2 /* 1 /*
3 * Copyright 2011 Google Inc. 2 * Copyright 2016 Google Inc.
4 * 3 *
5 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 5 * found in the LICENSE file.
7 */ 6 */
8 7
9 #ifndef SkNWayCanvas_DEFINED 8 #ifndef SkPipeCanvas_DEFINED
10 #define SkNWayCanvas_DEFINED 9 #define SkPipeCanvas_DEFINED
11 10
12 #include "../private/SkTDArray.h"
13 #include "SkCanvas.h" 11 #include "SkCanvas.h"
12 #include "SkWriteBuffer.h"
14 13
15 class SK_API SkNWayCanvas : public SkCanvas { 14 class SkPipeCanvas : public SkCanvas {
16 public: 15 public:
17 SkNWayCanvas(int width, int height); 16 SkPipeCanvas(int width, int height, SkWStream*);
18 virtual ~SkNWayCanvas(); 17 ~SkPipeCanvas() override;
19
20 virtual void addCanvas(SkCanvas*);
21 virtual void removeCanvas(SkCanvas*);
22 virtual void removeAll();
23
24 ///////////////////////////////////////////////////////////////////////////
25 // These are forwarded to the N canvases we're referencing
26
27 #ifdef SK_SUPPORT_LEGACY_DRAWFILTER
28 SkDrawFilter* setDrawFilter(SkDrawFilter*) override;
29 #endif
30 18
31 protected: 19 protected:
32 SkTDArray<SkCanvas*> fList;
33
34 void willSave() override; 20 void willSave() override;
35 SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec&) override; 21 SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec&) override;
36 void willRestore() override; 22 void willRestore() override;
37 23
38 void didConcat(const SkMatrix&) override; 24 void didConcat(const SkMatrix&) override;
39 void didSetMatrix(const SkMatrix&) override; 25 void didSetMatrix(const SkMatrix&) override;
40 26
41 void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override; 27 void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override;
42 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkS calar y, 28 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkS calar y,
43 const SkPaint&) override; 29 const SkPaint&) override;
(...skipping 13 matching lines...) Expand all
57 43
58 void onDrawPaint(const SkPaint&) override; 44 void onDrawPaint(const SkPaint&) override;
59 void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPain t&) override; 45 void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPain t&) override;
60 void onDrawRect(const SkRect&, const SkPaint&) override; 46 void onDrawRect(const SkRect&, const SkPaint&) override;
61 void onDrawOval(const SkRect&, const SkPaint&) override; 47 void onDrawOval(const SkRect&, const SkPaint&) override;
62 void onDrawRRect(const SkRRect&, const SkPaint&) override; 48 void onDrawRRect(const SkRRect&, const SkPaint&) override;
63 void onDrawPath(const SkPath&, const SkPaint&) override; 49 void onDrawPath(const SkPath&, const SkPaint&) override;
64 void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPain t*) override; 50 void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPain t*) override;
65 void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*, 51 void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*,
66 SrcRectConstraint) override; 52 SrcRectConstraint) override;
53 void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
54 const SkPaint*) override;
67 void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint* ) override; 55 void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint* ) override;
68 void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst, 56 void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
69 const SkPaint*, SrcRectConstraint) override; 57 const SkPaint*, SrcRectConstraint) override;
70 void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst, 58 void onDrawImageNine(const SkImage*, const SkIRect& center, const SkRect& ds t,
71 const SkPaint*) override; 59 const SkPaint*) override;
72 void onDrawVertices(VertexMode vmode, int vertexCount, 60 void onDrawVertices(VertexMode vmode, int vertexCount,
73 const SkPoint vertices[], const SkPoint texs[], 61 const SkPoint vertices[], const SkPoint texs[],
74 const SkColor colors[], SkXfermode* xmode, 62 const SkColor colors[], SkXfermode* xmode,
75 const uint16_t indices[], int indexCount, 63 const uint16_t indices[], int indexCount,
76 const SkPaint&) override; 64 const SkPaint&) override;
77 65
78 void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) override; 66 void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) override;
79 void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) override; 67 void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) override;
80 void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) override; 68 void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) override;
81 void onClipRegion(const SkRegion&, SkRegion::Op) override; 69 void onClipRegion(const SkRegion&, SkRegion::Op) override;
82 70
83 void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) overri de; 71 void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) overri de;
84 void onDrawAnnotation(const SkRect&, const char[], SkData*) override; 72 void onDrawAnnotation(const SkRect&, const char[], SkData*) override;
85 73
86 class Iter; 74 private:
75 void writeVerb(int);
87 76
88 private: 77 SkWStream* fStream;
78
89 typedef SkCanvas INHERITED; 79 typedef SkCanvas INHERITED;
90 }; 80 };
91 81
92 82
93 #endif 83 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698