Florin Malita | ee424ac | 2016-12-01 12:47:59 -0500 | [diff] [blame] | 1 | /* |
| 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 Malita | 439ace9 | 2016-12-02 12:05:41 -0500 | [diff] [blame^] | 13 | struct SkIRect; |
| 14 | |
Florin Malita | ee424ac | 2016-12-01 12:47:59 -0500 | [diff] [blame] | 15 | // 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 | // |
| 23 | class SK_API SkNoDrawCanvas : public SkCanvas { |
| 24 | public: |
| 25 | SkNoDrawCanvas(int width, int height); |
| 26 | |
Florin Malita | 439ace9 | 2016-12-02 12:05:41 -0500 | [diff] [blame^] | 27 | // TODO: investigate the users of this ctor. |
| 28 | SkNoDrawCanvas(const SkIRect&); |
| 29 | |
Florin Malita | ee424ac | 2016-12-01 12:47:59 -0500 | [diff] [blame] | 30 | protected: |
| 31 | SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec& rec) override; |
| 32 | |
| 33 | private: |
| 34 | typedef SkCanvas INHERITED; |
| 35 | }; |
| 36 | |
Florin Malita | 4b7b6f0 | 2016-12-01 15:46:26 -0500 | [diff] [blame] | 37 | #endif // SkNoDrawCanvas_DEFINED |