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 private: | 25 protected: |
26 /** | 26 /** |
27 * Construct a new device with the specified bitmap as its backend. It is | 27 * 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, | 28 * valid for the bitmap to have no pixels associated with it. In that case, |
29 * any drawing to this device will have no effect. | 29 * any drawing to this device will have no effect. |
30 */ | 30 */ |
31 SkBitmapDevice(const SkBitmap& bitmap, const SkDeviceProperties& devicePrope
rties); | 31 SkBitmapDevice(const SkBitmap& bitmap, const SkSurfaceProps& surfaceProps); |
32 static SkBitmapDevice* Create(const SkImageInfo&, const SkDeviceProperties*)
; | 32 private: |
| 33 static SkBitmapDevice* Create(const SkImageInfo&, const SkSurfaceProps*); |
33 public: | 34 public: |
34 static SkBitmapDevice* Create(const SkImageInfo& info) { | 35 static SkBitmapDevice* Create(const SkImageInfo& info) { |
35 return Create(info, NULL); | 36 return Create(info, NULL); |
36 } | 37 } |
37 | 38 |
38 SkImageInfo imageInfo() const override; | 39 SkImageInfo imageInfo() const override; |
39 | 40 |
40 protected: | 41 protected: |
41 bool onShouldDisableLCD(const SkPaint&) const override; | 42 bool onShouldDisableLCD(const SkPaint&) const override; |
42 | 43 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 SkImageFilter::Cache* getImageFilterCache() override; | 145 SkImageFilter::Cache* getImageFilterCache() override; |
145 | 146 |
146 SkBitmap fBitmap; | 147 SkBitmap fBitmap; |
147 | 148 |
148 void setNewSize(const SkISize&); // Used by SkCanvas for resetForNextPictur
e(). | 149 void setNewSize(const SkISize&); // Used by SkCanvas for resetForNextPictur
e(). |
149 | 150 |
150 typedef SkBaseDevice INHERITED; | 151 typedef SkBaseDevice INHERITED; |
151 }; | 152 }; |
152 | 153 |
153 #endif // SkBitmapDevice_DEFINED | 154 #endif // SkBitmapDevice_DEFINED |
OLD | NEW |