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 SkCanvasPriv_DEFINED
9 #define SkCanvasPriv_DEFINED
10 
11 #include "SkCanvas.h"
12 
13 class SkReadBuffer;
14 class SkWriteBuffer;
15 
16 class SkAutoCanvasMatrixPaint : SkNoncopyable {
17 public:
18     SkAutoCanvasMatrixPaint(SkCanvas*, const SkMatrix*, const SkPaint*, const SkRect& bounds);
19     ~SkAutoCanvasMatrixPaint();
20 
21 private:
22     SkCanvas*   fCanvas;
23     int         fSaveCount;
24 };
25 
26 class SkCanvasPriv {
27 public:
28     // The lattice has pointers directly into the readbuffer
29     static bool ReadLattice(SkReadBuffer&, SkCanvas::Lattice*);
30 
31     static void WriteLattice(SkWriteBuffer&, const SkCanvas::Lattice&);
32 
33     // return the byte-size of the lattice, even if the buffer is null
34     // storage must be 4-byte aligned
35     static size_t WriteLattice(void* storage, const SkCanvas::Lattice&);
36 };
37 
38 #endif
39