Chromium Code Reviews| 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 |
| 11 #define SkDevice_DEFINED | 11 #define SkDevice_DEFINED |
| 12 | 12 |
| 13 #include "SkRefCnt.h" | 13 #include "SkRefCnt.h" |
| 14 #include "SkBitmap.h" | 14 #include "SkBitmap.h" |
| 15 #include "SkCanvas.h" | 15 #include "SkCanvas.h" |
| 16 #include "SkColor.h" | 16 #include "SkColor.h" |
| 17 #include "SkDeviceProperties.h" | 17 #include "SkDeviceProperties.h" |
| 18 | 18 |
| 19 // getDeviceCapabilities() is not called by skia, but this flag keeps it around | |
| 20 // for clients that have "override" annotations on their subclass. These overrid es | |
|
vandebo (ex-Chrome)
2014/03/13 17:21:17
Why not do this first?
reed1
2014/03/13 18:15:33
I will land this Skia change first, which gives a
vandebo (ex-Chrome)
2014/03/13 18:19:56
Oh, it's pure virtual, I see.
| |
| 21 // should be deleted. | |
| 22 //#define SK_SUPPORT_LEGACY_GETDEVICECAPABILITIES | |
| 23 | |
| 19 //#define SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG | 24 //#define SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG |
| 20 | 25 |
| 21 class SkClipStack; | 26 class SkClipStack; |
| 22 class SkDraw; | 27 class SkDraw; |
| 23 struct SkIRect; | 28 struct SkIRect; |
| 24 class SkMatrix; | 29 class SkMatrix; |
| 25 class SkMetaData; | 30 class SkMetaData; |
| 26 class SkRegion; | 31 class SkRegion; |
| 27 | 32 |
| 28 class GrRenderTarget; | 33 class GrRenderTarget; |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 56 * be opaque. | 61 * be opaque. |
| 57 */ | 62 */ |
| 58 SkBaseDevice* createCompatibleDevice(SkBitmap::Config config, | 63 SkBaseDevice* createCompatibleDevice(SkBitmap::Config config, |
| 59 int width, int height, | 64 int width, int height, |
| 60 bool isOpaque); | 65 bool isOpaque); |
| 61 #endif | 66 #endif |
| 62 SkBaseDevice* createCompatibleDevice(const SkImageInfo&); | 67 SkBaseDevice* createCompatibleDevice(const SkImageInfo&); |
| 63 | 68 |
| 64 SkMetaData& getMetaData(); | 69 SkMetaData& getMetaData(); |
| 65 | 70 |
| 66 enum Capabilities { | 71 #ifdef SK_SUPPORT_LEGACY_GETDEVICECAPABILITIES |
| 67 kVector_Capability = 0x1, //!< mask indicating a vector representation | 72 virtual uint32_t getDeviceCapabilities() { return 0; } |
| 68 }; | 73 #endif |
| 69 virtual uint32_t getDeviceCapabilities() = 0; | |
| 70 | 74 |
| 71 /** Return the width of the device (in pixels). | 75 /** Return the width of the device (in pixels). |
| 72 */ | 76 */ |
| 73 virtual int width() const = 0; | 77 virtual int width() const = 0; |
| 74 /** Return the height of the device (in pixels). | 78 /** Return the height of the device (in pixels). |
| 75 */ | 79 */ |
| 76 virtual int height() const = 0; | 80 virtual int height() const = 0; |
| 77 | 81 |
| 78 /** Return the image properties of the device. */ | 82 /** Return the image properties of the device. */ |
| 79 virtual const SkDeviceProperties& getDeviceProperties() const { | 83 virtual const SkDeviceProperties& getDeviceProperties() const { |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 460 SkMetaData* fMetaData; | 464 SkMetaData* fMetaData; |
| 461 | 465 |
| 462 #ifdef SK_DEBUG | 466 #ifdef SK_DEBUG |
| 463 bool fAttachedToCanvas; | 467 bool fAttachedToCanvas; |
| 464 #endif | 468 #endif |
| 465 | 469 |
| 466 typedef SkRefCnt INHERITED; | 470 typedef SkRefCnt INHERITED; |
| 467 }; | 471 }; |
| 468 | 472 |
| 469 #endif | 473 #endif |
| OLD | NEW |