OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 The Android Open Source Project | 3 * Copyright 2010 The Android Open Source Project |
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 | 9 |
10 #ifndef SkDevice_DEFINED | 10 #ifndef SkDevice_DEFINED |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 * it just returns false and leaves result and offset unchanged. | 360 * it just returns false and leaves result and offset unchanged. |
361 */ | 361 */ |
362 virtual bool filterImage(SkImageFilter*, const SkBitmap&, const SkMatrix&, | 362 virtual bool filterImage(SkImageFilter*, const SkBitmap&, const SkMatrix&, |
363 SkBitmap* result, SkIPoint* offset) = 0; | 363 SkBitmap* result, SkIPoint* offset) = 0; |
364 | 364 |
365 // This is equal kBGRA_Premul_Config8888 or kRGBA_Premul_Config8888 if | 365 // This is equal kBGRA_Premul_Config8888 or kRGBA_Premul_Config8888 if |
366 // either is identical to kNative_Premul_Config8888. Otherwise, -1. | 366 // either is identical to kNative_Premul_Config8888. Otherwise, -1. |
367 static const SkCanvas::Config8888 kPMColorAlias; | 367 static const SkCanvas::Config8888 kPMColorAlias; |
368 | 368 |
369 protected: | 369 protected: |
| 370 // default impl returns NULL |
| 371 virtual SkSurface* newSurface(const SkImageInfo&); |
| 372 |
370 /** | 373 /** |
371 * Leaky properties are those which the device should be applying but it is
n't. | 374 * Leaky properties are those which the device should be applying but it is
n't. |
372 * These properties will be applied by the draw, when and as it can. | 375 * These properties will be applied by the draw, when and as it can. |
373 * If the device does handle a property, that property should be set to the
identity value | 376 * If the device does handle a property, that property should be set to the
identity value |
374 * for that property, effectively making it non-leaky. | 377 * for that property, effectively making it non-leaky. |
375 */ | 378 */ |
376 SkDeviceProperties fLeakyProperties; | 379 SkDeviceProperties fLeakyProperties; |
377 | 380 |
378 private: | 381 private: |
379 friend class SkCanvas; | 382 friend class SkCanvas; |
380 friend struct DeviceCM; //for setMatrixClip | 383 friend struct DeviceCM; //for setMatrixClip |
381 friend class SkDraw; | 384 friend class SkDraw; |
382 friend class SkDrawIter; | 385 friend class SkDrawIter; |
383 friend class SkDeviceFilteredPaint; | 386 friend class SkDeviceFilteredPaint; |
384 friend class SkDeviceImageFilterProxy; | 387 friend class SkDeviceImageFilterProxy; |
| 388 friend class DeferredDevice; // for newSurface |
385 | 389 |
386 friend class SkSurface_Raster; | 390 friend class SkSurface_Raster; |
387 | 391 |
388 // used to change the backend's pixels (and possibly config/rowbytes) | 392 // used to change the backend's pixels (and possibly config/rowbytes) |
389 // but cannot change the width/height, so there should be no change to | 393 // but cannot change the width/height, so there should be no change to |
390 // any clip information. | 394 // any clip information. |
391 // TODO: move to SkBitmapDevice | 395 // TODO: move to SkBitmapDevice |
392 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) = 0; | 396 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) = 0; |
393 | 397 |
394 // just called by SkCanvas when built as a layer | 398 // just called by SkCanvas when built as a layer |
(...skipping 19 matching lines...) Expand all Loading... |
414 SkMetaData* fMetaData; | 418 SkMetaData* fMetaData; |
415 | 419 |
416 #ifdef SK_DEBUG | 420 #ifdef SK_DEBUG |
417 bool fAttachedToCanvas; | 421 bool fAttachedToCanvas; |
418 #endif | 422 #endif |
419 | 423 |
420 typedef SkRefCnt INHERITED; | 424 typedef SkRefCnt INHERITED; |
421 }; | 425 }; |
422 | 426 |
423 #endif | 427 #endif |
OLD | NEW |