| 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 | 25 private: |
| 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 SkDeviceProperties& devicePrope
rties); |
| 32 | 32 static SkBitmapDevice* Create(const SkImageInfo&, const SkDeviceProperties*)
; |
| 33 static SkBitmapDevice* Create(const SkImageInfo&, | 33 public: |
| 34 const SkDeviceProperties* = NULL); | 34 static SkBitmapDevice* Create(const SkImageInfo& info) { |
| 35 return Create(info, NULL); |
| 36 } |
| 35 | 37 |
| 36 virtual SkImageInfo imageInfo() const SK_OVERRIDE; | 38 virtual SkImageInfo imageInfo() const SK_OVERRIDE; |
| 37 | 39 |
| 38 protected: | 40 protected: |
| 39 virtual bool filterTextFlags(const SkPaint& paint, TextFlags*) SK_OVERRIDE; | 41 virtual bool filterTextFlags(const SkPaint& paint, TextFlags*) SK_OVERRIDE; |
| 40 | 42 |
| 41 /** Clears the entire device to the specified color (including alpha). | 43 /** Clears the entire device to the specified color (including alpha). |
| 42 * Ignores the clip. | 44 * Ignores the clip. |
| 43 */ | 45 */ |
| 44 virtual void clear(SkColor color) SK_OVERRIDE; | 46 virtual void clear(SkColor color) SK_OVERRIDE; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes) SK_OVERRIDE; | 159 virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes) SK_OVERRIDE; |
| 158 | 160 |
| 159 virtual SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE; | 161 virtual SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE; |
| 160 | 162 |
| 161 SkBitmap fBitmap; | 163 SkBitmap fBitmap; |
| 162 | 164 |
| 163 typedef SkBaseDevice INHERITED; | 165 typedef SkBaseDevice INHERITED; |
| 164 }; | 166 }; |
| 165 | 167 |
| 166 #endif // SkBitmapDevice_DEFINED | 168 #endif // SkBitmapDevice_DEFINED |
| OLD | NEW |