Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkMultiPictureDraw.h
1 /*
2  * Copyright 2014 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkMultiPictureDraw_DEFINED
9 #define SkMultiPictureDraw_DEFINED
10 
11 #include "../private/SkTDArray.h"
12 #include "SkMatrix.h"
13 
14 class SkCanvas;
15 class SkPaint;
16 class SkPicture;
17 
24 class SK_API SkMultiPictureDraw {
25 public:
30  SkMultiPictureDraw(int reserve = 0);
31  ~SkMultiPictureDraw() { this->reset(); }
32 
41  void add(SkCanvas* canvas,
42  const SkPicture* picture,
43  const SkMatrix* matrix = NULL,
44  const SkPaint* paint = NULL);
45 
51  void draw(bool flush = false);
52 
56  void reset();
57 
58 private:
59  struct DrawData {
60  SkCanvas* fCanvas;
61  const SkPicture* fPicture; // reffed
62  SkMatrix fMatrix;
63  SkPaint* fPaint; // owned
64 
65  void init(SkCanvas*, const SkPicture*, const SkMatrix*, const SkPaint*);
66  void draw();
67 
68  static void Reset(SkTDArray<DrawData>&);
69  };
70 
71  SkTDArray<DrawData> fThreadSafeDrawData;
72  SkTDArray<DrawData> fGPUDrawData;
73 };
74 
75 #endif
A Canvas encapsulates all of the state about drawing into a device (bitmap).
Definition: SkCanvas.h:59
The MultiPictureDraw object accepts several picture/canvas pairs and then attempts to optimally draw ...
Definition: SkMultiPictureDraw.h:24
The SkMatrix class holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:28
The SkPaint class holds the style and color information about how to draw geometries, text and bitmaps.
Definition: SkPaint.h:45
An SkPicture records drawing commands made to a canvas to be played back at a later time...
Definition: SkPicture.h:38
Definition: SkMultiPictureDraw.h:59