blob: e8c5d7e5caba9f30e522e68302087ea087847542 [file] [log] [blame]
Florin Malitaee424ac2016-12-01 12:47:59 -05001/*
2 * Copyright 2016 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 SkNoDrawCanvas_DEFINED
9#define SkNoDrawCanvas_DEFINED
10
11#include "SkCanvas.h"
12
Florin Malita439ace92016-12-02 12:05:41 -050013struct SkIRect;
14
Florin Malitaee424ac2016-12-01 12:47:59 -050015// SkNoDrawCanvas is a helper for SkCanvas subclasses which do not need to
16// actually rasterize (e.g., analysis of the draw calls).
17//
18// It provides the following simplifications:
19//
20// * not backed by any device/pixels
21// * conservative clipping (clipping calls only use rectangles)
22//
23class SK_API SkNoDrawCanvas : public SkCanvas {
24public:
25 SkNoDrawCanvas(int width, int height);
26
Florin Malita439ace92016-12-02 12:05:41 -050027 // TODO: investigate the users of this ctor.
28 SkNoDrawCanvas(const SkIRect&);
29
Florin Malitaee424ac2016-12-01 12:47:59 -050030protected:
31 SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec& rec) override;
32
33private:
34 typedef SkCanvas INHERITED;
35};
36
Florin Malita4b7b6f02016-12-01 15:46:26 -050037#endif // SkNoDrawCanvas_DEFINED