OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef SkBitmapDevice_DEFINED | 9 #ifndef SkBitmapDevice_DEFINED |
10 #define SkBitmapDevice_DEFINED | 10 #define SkBitmapDevice_DEFINED |
11 | 11 |
12 #include "SkDevice.h" | 12 #include "SkDevice.h" |
13 | 13 |
14 /////////////////////////////////////////////////////////////////////////////// | 14 /////////////////////////////////////////////////////////////////////////////// |
15 class SK_API SkBitmapDevice : public SkBaseDevice { | 15 class SK_API SkBitmapDevice : public SkBaseDevice { |
16 public: | 16 public: |
17 SK_DECLARE_INST_COUNT(SkBitmapDevice) | 17 SK_DECLARE_INST_COUNT(SkBitmapDevice) |
18 | 18 |
19 /** | 19 /** |
20 * Construct a new device with the specified bitmap as its backend. It is | 20 * Construct a new device with the specified bitmap as its backend. It is |
21 * valid for the bitmap to have no pixels associated with it. In that case, | 21 * valid for the bitmap to have no pixels associated with it. In that case, |
22 * any drawing to this device will have no effect. | 22 * any drawing to this device will have no effect. |
23 */ | 23 */ |
24 SkBitmapDevice(const SkBitmap& bitmap); | 24 SkBitmapDevice(const SkBitmap& bitmap); |
25 protected: | 25 |
26 static SkBitmapDevice* Create(const SkImageInfo& info); | |
reed1
2015/06/22 15:44:57
Can we add dox to this factory?
- does it alloc pi
robertphillips
2015/06/22 16:10:51
Done. I have added documentation but this is just
| |
27 | |
26 /** | 28 /** |
27 * Construct a new device with the specified bitmap as its backend. It is | 29 * Construct a new device with the specified bitmap as its backend. It is |
28 * valid for the bitmap to have no pixels associated with it. In that case, | 30 * valid for the bitmap to have no pixels associated with it. In that case, |
29 * any drawing to this device will have no effect. | 31 * any drawing to this device will have no effect. |
30 */ | 32 */ |
31 SkBitmapDevice(const SkBitmap& bitmap, const SkSurfaceProps& surfaceProps); | 33 SkBitmapDevice(const SkBitmap& bitmap, const SkSurfaceProps& surfaceProps); |
32 private: | 34 |
33 static SkBitmapDevice* Create(const SkImageInfo&, const SkSurfaceProps*); | 35 static SkBitmapDevice* Create(const SkImageInfo&, const SkSurfaceProps&); |
34 public: | |
35 static SkBitmapDevice* Create(const SkImageInfo& info) { | |
36 return Create(info, NULL); | |
37 } | |
38 | 36 |
39 SkImageInfo imageInfo() const override; | 37 SkImageInfo imageInfo() const override; |
40 | 38 |
41 protected: | 39 protected: |
42 bool onShouldDisableLCD(const SkPaint&) const override; | 40 bool onShouldDisableLCD(const SkPaint&) const override; |
43 | 41 |
44 /** These are called inside the per-device-layer loop for each draw call. | 42 /** These are called inside the per-device-layer loop for each draw call. |
45 When these are called, we have already applied any saveLayer operations, | 43 When these are called, we have already applied any saveLayer operations, |
46 and are handling any looping from the paint, and any effects from the | 44 and are handling any looping from the paint, and any effects from the |
47 DrawFilter. | 45 DrawFilter. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 SkImageFilter::Cache* getImageFilterCache() override; | 143 SkImageFilter::Cache* getImageFilterCache() override; |
146 | 144 |
147 SkBitmap fBitmap; | 145 SkBitmap fBitmap; |
148 | 146 |
149 void setNewSize(const SkISize&); // Used by SkCanvas for resetForNextPictur e(). | 147 void setNewSize(const SkISize&); // Used by SkCanvas for resetForNextPictur e(). |
150 | 148 |
151 typedef SkBaseDevice INHERITED; | 149 typedef SkBaseDevice INHERITED; |
152 }; | 150 }; |
153 | 151 |
154 #endif // SkBitmapDevice_DEFINED | 152 #endif // SkBitmapDevice_DEFINED |
OLD | NEW |