Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008-2009 Torch Mobile, Inc. | 3 * Copyright (C) 2008-2009 Torch Mobile, Inc. |
| 4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #ifndef GraphicsContext_h | 28 #ifndef GraphicsContext_h |
| 29 #define GraphicsContext_h | 29 #define GraphicsContext_h |
| 30 | 30 |
| 31 #include "platform/PlatformExport.h" | 31 #include "platform/PlatformExport.h" |
| 32 #include "platform/fonts/Font.h" | 32 #include "platform/fonts/Font.h" |
| 33 #include "platform/geometry/FloatRect.h" | |
| 34 #include "platform/geometry/FloatRoundedRect.h" | |
| 35 #include "platform/graphics/DashArray.h" | 33 #include "platform/graphics/DashArray.h" |
| 36 #include "platform/graphics/DrawLooperBuilder.h" | 34 #include "platform/graphics/DrawLooperBuilder.h" |
| 37 #include "platform/graphics/GraphicsContextState.h" | 35 #include "platform/graphics/GraphicsContextState.h" |
| 38 #include "platform/graphics/ImageOrientation.h" | 36 #include "platform/graphics/ImageOrientation.h" |
| 39 #include "platform/graphics/skia/SkiaUtils.h" | 37 #include "platform/graphics/skia/SkiaUtils.h" |
| 40 #include "third_party/skia/include/core/SkMetaData.h" | 38 #include "third_party/skia/include/core/SkMetaData.h" |
| 41 #include "third_party/skia/include/core/SkPictureRecorder.h" | 39 #include "third_party/skia/include/core/SkPictureRecorder.h" |
| 42 #include "third_party/skia/include/core/SkRegion.h" | 40 #include "third_party/skia/include/core/SkRegion.h" |
| 43 #include "wtf/Allocator.h" | 41 #include "wtf/Allocator.h" |
| 44 #include "wtf/Forward.h" | 42 #include "wtf/Forward.h" |
| 45 #include "wtf/Noncopyable.h" | 43 #include "wtf/Noncopyable.h" |
| 46 #include "wtf/PassOwnPtr.h" | 44 #include "wtf/PassOwnPtr.h" |
| 47 | 45 |
| 48 class SkBitmap; | 46 class SkBitmap; |
| 49 class SkImage; | 47 class SkImage; |
| 50 class SkPaint; | 48 class SkPaint; |
| 51 class SkPath; | 49 class SkPath; |
| 52 class SkPicture; | 50 class SkPicture; |
| 53 class SkRRect; | 51 class SkRRect; |
| 54 class SkTextBlob; | 52 class SkTextBlob; |
| 55 struct SkImageInfo; | 53 struct SkImageInfo; |
| 56 struct SkRect; | 54 struct SkRect; |
| 57 | 55 |
| 58 namespace blink { | 56 namespace blink { |
| 59 | 57 |
| 58 class FloatRect; | |
| 59 class FloatRoundedRect; | |
| 60 class ImageBuffer; | 60 class ImageBuffer; |
| 61 class KURL; | 61 class KURL; |
| 62 class PaintController; | 62 class PaintController; |
| 63 class Path; | 63 class Path; |
| 64 | 64 |
| 65 class PLATFORM_EXPORT GraphicsContext { | 65 class PLATFORM_EXPORT GraphicsContext { |
| 66 WTF_MAKE_NONCOPYABLE(GraphicsContext); USING_FAST_MALLOC(GraphicsContext); | 66 WTF_MAKE_NONCOPYABLE(GraphicsContext); USING_FAST_MALLOC(GraphicsContext); |
| 67 public: | 67 public: |
| 68 enum DisabledMode { | 68 enum DisabledMode { |
| 69 NothingDisabled = 0, // Run as normal. | 69 NothingDisabled = 0, // Run as normal. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 void fillRoundedRect(const FloatRoundedRect&, const Color&); | 155 void fillRoundedRect(const FloatRoundedRect&, const Color&); |
| 156 void fillDRRect(const FloatRoundedRect&, const FloatRoundedRect&, const Colo r&); | 156 void fillDRRect(const FloatRoundedRect&, const FloatRoundedRect&, const Colo r&); |
| 157 | 157 |
| 158 void strokeRect(const FloatRect&, float lineWidth); | 158 void strokeRect(const FloatRect&, float lineWidth); |
| 159 | 159 |
| 160 void drawPicture(const SkPicture*); | 160 void drawPicture(const SkPicture*); |
| 161 void compositePicture(PassRefPtr<SkPicture>, const FloatRect& dest, const Fl oatRect& src, SkXfermode::Mode); | 161 void compositePicture(PassRefPtr<SkPicture>, const FloatRect& dest, const Fl oatRect& src, SkXfermode::Mode); |
| 162 | 162 |
| 163 void drawImage(Image*, const FloatRect& destRect, const FloatRect* srcRect = nullptr, | 163 void drawImage(Image*, const FloatRect& destRect, const FloatRect* srcRect = nullptr, |
| 164 SkXfermode::Mode = SkXfermode::kSrcOver_Mode, RespectImageOrientationEnu m = DoNotRespectImageOrientation); | 164 SkXfermode::Mode = SkXfermode::kSrcOver_Mode, RespectImageOrientationEnu m = DoNotRespectImageOrientation); |
| 165 void drawImageRRect(Image*, const FloatRoundedRect& dest, const FloatRect* s rcRect = nullptr, | |
|
chrishtr
2016/05/20 15:44:13
Make the srcRect parameter required.
f(malita)
2016/05/20 19:17:11
Done.
| |
| 166 SkXfermode::Mode = SkXfermode::kSrcOver_Mode, RespectImageOrientationEnu m = DoNotRespectImageOrientation); | |
| 165 void drawTiledImage(Image*, const FloatRect& destRect, const FloatPoint& src Point, const FloatSize& tileSize, | 167 void drawTiledImage(Image*, const FloatRect& destRect, const FloatPoint& src Point, const FloatSize& tileSize, |
| 166 SkXfermode::Mode = SkXfermode::kSrcOver_Mode, const FloatSize& repeatSpa cing = FloatSize()); | 168 SkXfermode::Mode = SkXfermode::kSrcOver_Mode, const FloatSize& repeatSpa cing = FloatSize()); |
| 167 void drawTiledImage(Image*, const FloatRect& destRect, const FloatRect& srcR ect, | 169 void drawTiledImage(Image*, const FloatRect& destRect, const FloatRect& srcR ect, |
| 168 const FloatSize& tileScaleFactor, Image::TileRule hRule = Image::Stretch Tile, Image::TileRule vRule = Image::StretchTile, | 170 const FloatSize& tileScaleFactor, Image::TileRule hRule = Image::Stretch Tile, Image::TileRule vRule = Image::StretchTile, |
| 169 SkXfermode::Mode = SkXfermode::kSrcOver_Mode); | 171 SkXfermode::Mode = SkXfermode::kSrcOver_Mode); |
| 170 | 172 |
| 171 // These methods write to the canvas. | 173 // These methods write to the canvas. |
| 172 // Also drawLine(const IntPoint& point1, const IntPoint& point2) and fillRou ndedRect | 174 // Also drawLine(const IntPoint& point1, const IntPoint& point2) and fillRou ndedRect |
| 173 void drawOval(const SkRect&, const SkPaint&); | 175 void drawOval(const SkRect&, const SkPaint&); |
| 174 void drawPath(const SkPath&, const SkPaint&); | 176 void drawPath(const SkPath&, const SkPaint&); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 370 | 372 |
| 371 float m_deviceScaleFactor; | 373 float m_deviceScaleFactor; |
| 372 | 374 |
| 373 unsigned m_printing : 1; | 375 unsigned m_printing : 1; |
| 374 unsigned m_hasMetaData : 1; | 376 unsigned m_hasMetaData : 1; |
| 375 }; | 377 }; |
| 376 | 378 |
| 377 } // namespace blink | 379 } // namespace blink |
| 378 | 380 |
| 379 #endif // GraphicsContext_h | 381 #endif // GraphicsContext_h |
| OLD | NEW |