| 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 10 matching lines...) Expand all Loading... |
| 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 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 "core/platform/graphics/Font.h" | 31 #include "platform/PlatformExport.h" |
| 32 #include "core/platform/graphics/GraphicsContextAnnotation.h" | |
| 33 #include "core/platform/graphics/GraphicsContextState.h" | |
| 34 #include "core/platform/graphics/ImageBuffer.h" | |
| 35 #include "core/platform/graphics/skia/OpaqueRegionSkia.h" | |
| 36 #include "core/platform/graphics/skia/SkiaUtils.h" | |
| 37 #include "platform/TraceEvent.h" | 32 #include "platform/TraceEvent.h" |
| 33 #include "platform/fonts/Font.h" |
| 38 #include "platform/geometry/FloatRect.h" | 34 #include "platform/geometry/FloatRect.h" |
| 39 #include "platform/graphics/DashArray.h" | 35 #include "platform/graphics/DashArray.h" |
| 40 #include "platform/graphics/DrawLooper.h" | 36 #include "platform/graphics/DrawLooper.h" |
| 37 #include "platform/graphics/ImageBuffer.h" |
| 41 #include "platform/graphics/ImageOrientation.h" | 38 #include "platform/graphics/ImageOrientation.h" |
| 39 #include "platform/graphics/GraphicsContextAnnotation.h" |
| 40 #include "platform/graphics/GraphicsContextState.h" |
| 41 #include "platform/graphics/skia/OpaqueRegionSkia.h" |
| 42 #include "platform/graphics/skia/SkiaUtils.h" |
| 42 // TODO(robertphillips): replace this include with "class SkBaseDevice;" | 43 // TODO(robertphillips): replace this include with "class SkBaseDevice;" |
| 43 #include "third_party/skia/include/core/SkDevice.h" | 44 #include "third_party/skia/include/core/SkDevice.h" |
| 44 #include "wtf/FastAllocBase.h" | 45 #include "wtf/FastAllocBase.h" |
| 45 #include "wtf/Forward.h" | 46 #include "wtf/Forward.h" |
| 46 #include "wtf/Noncopyable.h" | 47 #include "wtf/Noncopyable.h" |
| 47 #include "wtf/PassOwnPtr.h" | 48 #include "wtf/PassOwnPtr.h" |
| 48 | 49 |
| 49 class SkBitmap; | 50 class SkBitmap; |
| 50 class SkPaint; | 51 class SkPaint; |
| 51 class SkPath; | 52 class SkPath; |
| 52 class SkRRect; | 53 class SkRRect; |
| 53 struct SkRect; | 54 struct SkRect; |
| 54 | 55 |
| 55 namespace WebCore { | 56 namespace WebCore { |
| 56 | 57 |
| 57 class DisplayList; | 58 class DisplayList; |
| 58 class ImageBuffer; | 59 class ImageBuffer; |
| 59 class KURL; | 60 class KURL; |
| 60 | 61 |
| 61 class GraphicsContext { | 62 class PLATFORM_EXPORT GraphicsContext { |
| 62 WTF_MAKE_NONCOPYABLE(GraphicsContext); WTF_MAKE_FAST_ALLOCATED; | 63 WTF_MAKE_NONCOPYABLE(GraphicsContext); WTF_MAKE_FAST_ALLOCATED; |
| 63 public: | 64 public: |
| 64 enum AntiAliasingMode { | 65 enum AntiAliasingMode { |
| 65 NotAntiAliased, | 66 NotAntiAliased, |
| 66 AntiAliased | 67 AntiAliased |
| 67 }; | 68 }; |
| 68 enum AccessMode { | 69 enum AccessMode { |
| 69 ReadOnly, | 70 ReadOnly, |
| 70 ReadWrite | 71 ReadWrite |
| 71 }; | 72 }; |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 void setURLFragmentForRect(const String& name, const IntRect&); | 365 void setURLFragmentForRect(const String& name, const IntRect&); |
| 365 void addURLTargetAtPoint(const String& name, const IntPoint&); | 366 void addURLTargetAtPoint(const String& name, const IntPoint&); |
| 366 bool supportsURLFragments() { return printing(); } | 367 bool supportsURLFragments() { return printing(); } |
| 367 | 368 |
| 368 // Create an image buffer compatible with this context, with suitable resolu
tion | 369 // Create an image buffer compatible with this context, with suitable resolu
tion |
| 369 // for drawing into the buffer and then into this context. | 370 // for drawing into the buffer and then into this context. |
| 370 PassOwnPtr<ImageBuffer> createCompatibleBuffer(const IntSize&, bool hasAlpha
= true) const; | 371 PassOwnPtr<ImageBuffer> createCompatibleBuffer(const IntSize&, bool hasAlpha
= true) const; |
| 371 | 372 |
| 372 static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, floa
t strokeWidth, StrokeStyle); | 373 static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, floa
t strokeWidth, StrokeStyle); |
| 373 | 374 |
| 374 void beginAnnotation(const GraphicsContextAnnotation&); | 375 void beginAnnotation(const char*, const char*, const String&, const String&,
const String&); |
| 375 void endAnnotation(); | 376 void endAnnotation(); |
| 376 | 377 |
| 377 private: | 378 private: |
| 378 static void addCornerArc(SkPath*, const SkRect&, const IntSize&, int); | 379 static void addCornerArc(SkPath*, const SkRect&, const IntSize&, int); |
| 379 static void setPathFromConvexPoints(SkPath*, size_t, const FloatPoint*); | 380 static void setPathFromConvexPoints(SkPath*, size_t, const FloatPoint*); |
| 380 static void setRadii(SkVector*, IntSize, IntSize, IntSize, IntSize); | 381 static void setRadii(SkVector*, IntSize, IntSize, IntSize, IntSize); |
| 381 | 382 |
| 382 static PassRefPtr<SkColorFilter> WebCoreColorFilterToSkiaColorFilter(ColorFi
lter); | 383 static PassRefPtr<SkColorFilter> WebCoreColorFilterToSkiaColorFilter(ColorFi
lter); |
| 383 | 384 |
| 384 #if OS(MACOSX) | 385 #if OS(MACOSX) |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 // FIXME: Make this go away: crbug.com/236892 | 483 // FIXME: Make this go away: crbug.com/236892 |
| 483 bool m_updatingControlTints : 1; | 484 bool m_updatingControlTints : 1; |
| 484 bool m_accelerated : 1; | 485 bool m_accelerated : 1; |
| 485 bool m_isCertainlyOpaque : 1; | 486 bool m_isCertainlyOpaque : 1; |
| 486 bool m_printing : 1; | 487 bool m_printing : 1; |
| 487 }; | 488 }; |
| 488 | 489 |
| 489 } // namespace WebCore | 490 } // namespace WebCore |
| 490 | 491 |
| 491 #endif // GraphicsContext_h | 492 #endif // GraphicsContext_h |
| OLD | NEW |