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 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 private: | 251 private: |
252 friend class SkCanvas; | 252 friend class SkCanvas; |
253 friend struct DeviceCM; //for setMatrixClip | 253 friend struct DeviceCM; //for setMatrixClip |
254 friend class SkDraw; | 254 friend class SkDraw; |
255 friend class SkDrawIter; | 255 friend class SkDrawIter; |
256 friend class SkDeviceFilteredPaint; | 256 friend class SkDeviceFilteredPaint; |
257 friend class SkDeviceImageFilterProxy; | 257 friend class SkDeviceImageFilterProxy; |
258 | 258 |
259 friend class SkSurface_Raster; | 259 friend class SkSurface_Raster; |
260 | 260 |
| 261 void init(SkBitmap::Config config, int width, int height, bool isOpaque); |
| 262 |
261 // used to change the backend's pixels (and possibly config/rowbytes) | 263 // used to change the backend's pixels (and possibly config/rowbytes) |
262 // but cannot change the width/height, so there should be no change to | 264 // but cannot change the width/height, so there should be no change to |
263 // any clip information. | 265 // any clip information. |
264 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) SK_OVERRI
DE; | 266 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) SK_OVERRI
DE; |
265 | 267 |
266 /** | 268 /** |
267 * Subclasses should override this to implement createCompatibleDevice. | 269 * Subclasses should override this to implement createCompatibleDevice. |
268 */ | 270 */ |
269 virtual SkBaseDevice* onCreateCompatibleDevice(SkBitmap::Config config, | 271 virtual SkBaseDevice* onCreateCompatibleDevice(SkBitmap::Config config, |
270 int width, int height, | 272 int width, int height, |
271 bool isOpaque, | 273 bool isOpaque, |
272 Usage usage) SK_OVERRIDE; | 274 Usage usage) SK_OVERRIDE; |
273 | 275 |
274 /** Causes any deferred drawing to the device to be completed. | 276 /** Causes any deferred drawing to the device to be completed. |
275 */ | 277 */ |
276 virtual void flush() SK_OVERRIDE {} | 278 virtual void flush() SK_OVERRIDE {} |
277 | 279 |
278 SkBitmap fBitmap; | 280 SkBitmap fBitmap; |
279 | 281 |
280 typedef SkBaseDevice INHERITED; | 282 typedef SkBaseDevice INHERITED; |
281 }; | 283 }; |
282 | 284 |
283 #endif // SkBitmapDevice_DEFINED | 285 #endif // SkBitmapDevice_DEFINED |
OLD | NEW |