| 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 20 matching lines...) Expand all Loading... |
| 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" | 33 #include "platform/geometry/FloatRect.h" |
| 34 #include "platform/geometry/FloatRoundedRect.h" | 34 #include "platform/geometry/FloatRoundedRect.h" |
| 35 #include "platform/graphics/DashArray.h" | 35 #include "platform/graphics/DashArray.h" |
| 36 #include "platform/graphics/DrawLooperBuilder.h" | 36 #include "platform/graphics/DrawLooperBuilder.h" |
| 37 #include "platform/graphics/ImageOrientation.h" | 37 #include "platform/graphics/ImageOrientation.h" |
| 38 #include "platform/graphics/GraphicsContextAnnotation.h" | 38 #include "platform/graphics/GraphicsContextAnnotation.h" |
| 39 #include "platform/graphics/GraphicsContextState.h" | 39 #include "platform/graphics/GraphicsContextState.h" |
| 40 #include "platform/graphics/skia/SkiaUtils.h" | 40 #include "platform/graphics/skia/SkiaUtils.h" |
| 41 #include "third_party/skia/include/core/SkPictureRecorder.h" |
| 41 #include "third_party/skia/include/core/SkRegion.h" | 42 #include "third_party/skia/include/core/SkRegion.h" |
| 42 #include "wtf/FastAllocBase.h" | 43 #include "wtf/FastAllocBase.h" |
| 43 #include "wtf/Forward.h" | 44 #include "wtf/Forward.h" |
| 44 #include "wtf/Noncopyable.h" | 45 #include "wtf/Noncopyable.h" |
| 45 #include "wtf/PassOwnPtr.h" | 46 #include "wtf/PassOwnPtr.h" |
| 46 | 47 |
| 47 class SkBitmap; | 48 class SkBitmap; |
| 48 class SkImage; | 49 class SkImage; |
| 49 class SkPaint; | 50 class SkPaint; |
| 50 class SkPath; | 51 class SkPath; |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 } | 418 } |
| 418 } | 419 } |
| 419 | 420 |
| 420 void fillRectWithRoundedHole(const FloatRect&, const FloatRoundedRect& round
edHoleRect, const Color&); | 421 void fillRectWithRoundedHole(const FloatRect&, const FloatRoundedRect& round
edHoleRect, const Color&); |
| 421 | 422 |
| 422 bool isRecording() const; | 423 bool isRecording() const; |
| 423 | 424 |
| 424 // null indicates painting is contextDisabled. Never delete this object. | 425 // null indicates painting is contextDisabled. Never delete this object. |
| 425 SkCanvas* m_canvas; | 426 SkCanvas* m_canvas; |
| 426 | 427 |
| 428 // This stores the canvas object used to construct the GraphicsContext, if a
ny. It is only |
| 429 // used when Slimming Paint is active. |
| 430 SkCanvas* m_originalCanvas; |
| 431 |
| 427 // This being null indicates not to paint into a DisplayItemList, and instea
d directly into the canvas. | 432 // This being null indicates not to paint into a DisplayItemList, and instea
d directly into the canvas. |
| 428 DisplayItemList* m_displayItemList; | 433 DisplayItemList* m_displayItemList; |
| 429 | 434 |
| 430 ClipRecorderStack* m_clipRecorderStack; | 435 ClipRecorderStack* m_clipRecorderStack; |
| 431 | 436 |
| 432 // Paint states stack. Enables local drawing state change with save()/restor
e() calls. | 437 // Paint states stack. Enables local drawing state change with save()/restor
e() calls. |
| 433 // This state controls the appearance of drawn content. | 438 // This state controls the appearance of drawn content. |
| 434 // We do not delete from this stack to avoid memory churn. | 439 // We do not delete from this stack to avoid memory churn. |
| 435 Vector<OwnPtr<GraphicsContextState>> m_paintStateStack; | 440 Vector<OwnPtr<GraphicsContextState>> m_paintStateStack; |
| 436 // Current index on the stack. May not be the last thing on the stack. | 441 // Current index on the stack. May not be the last thing on the stack. |
| 437 unsigned m_paintStateIndex; | 442 unsigned m_paintStateIndex; |
| 438 // Raw pointer to the current state. | 443 // Raw pointer to the current state. |
| 439 GraphicsContextState* m_paintState; | 444 GraphicsContextState* m_paintState; |
| 440 | 445 |
| 441 AnnotationModeFlags m_annotationMode; | 446 AnnotationModeFlags m_annotationMode; |
| 442 | 447 |
| 448 // Only used when Slimming Paint is off. When it is on, m_pictureRecorder is
used instead. |
| 443 Vector<OwnPtr<RecordingState>> m_recordingStateStack; | 449 Vector<OwnPtr<RecordingState>> m_recordingStateStack; |
| 450 SkPictureRecorder m_pictureRecorder; |
| 444 | 451 |
| 445 #if ENABLE(ASSERT) | 452 #if ENABLE(ASSERT) |
| 446 unsigned m_layerCount; | 453 unsigned m_layerCount; |
| 447 unsigned m_annotationCount; | 454 unsigned m_annotationCount; |
| 448 bool m_disableDestructionChecks; | 455 bool m_disableDestructionChecks; |
| 449 bool m_inDrawingRecorder; | 456 bool m_inDrawingRecorder; |
| 450 #endif | 457 #endif |
| 451 | 458 |
| 452 const DisabledMode m_disabledState; | 459 const DisabledMode m_disabledState; |
| 453 | 460 |
| 454 float m_deviceScaleFactor; | 461 float m_deviceScaleFactor; |
| 455 | 462 |
| 456 unsigned m_accelerated : 1; | 463 unsigned m_accelerated : 1; |
| 457 unsigned m_printing : 1; | 464 unsigned m_printing : 1; |
| 458 unsigned m_antialiasHairlineImages : 1; | 465 unsigned m_antialiasHairlineImages : 1; |
| 459 }; | 466 }; |
| 460 | 467 |
| 461 } // namespace blink | 468 } // namespace blink |
| 462 | 469 |
| 463 #endif // GraphicsContext_h | 470 #endif // GraphicsContext_h |
| OLD | NEW |