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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // See bug# 372110 | 105 // See bug# 372110 |
106 bool isRecordingCanvas() const | 106 bool isRecordingCanvas() const |
107 { | 107 { |
108 return m_canvas->imageInfo().colorType() == kUnknown_SkColorType; | 108 return m_canvas->imageInfo().colorType() == kUnknown_SkColorType; |
109 } | 109 } |
110 | 110 |
111 // ---------- State management methods ----------------- | 111 // ---------- State management methods ----------------- |
112 void save(); | 112 void save(); |
113 void restore(); | 113 void restore(); |
114 unsigned saveCount() { return m_canvasStateStack.size(); } | 114 unsigned saveCount() { return m_canvasStateStack.size(); } |
115 #if ASSERT_ENABLED | 115 #if ENABLE(ASSERT) |
116 void disableDestructionChecks() { m_disableDestructionChecks = true; } | 116 void disableDestructionChecks() { m_disableDestructionChecks = true; } |
117 #endif | 117 #endif |
118 | 118 |
119 void saveLayer(const SkRect* bounds, const SkPaint*); | 119 void saveLayer(const SkRect* bounds, const SkPaint*); |
120 void restoreLayer(); | 120 void restoreLayer(); |
121 | 121 |
122 bool hasStroke() const { return strokeStyle() != NoStroke && strokeThickness
() > 0; } | 122 bool hasStroke() const { return strokeStyle() != NoStroke && strokeThickness
() > 0; } |
123 | 123 |
124 float strokeThickness() const { return immutableState()->strokeData().thickn
ess(); } | 124 float strokeThickness() const { return immutableState()->strokeData().thickn
ess(); } |
125 void setStrokeThickness(float thickness) { mutableState()->setStrokeThicknes
s(thickness); } | 125 void setStrokeThickness(float thickness) { mutableState()->setStrokeThicknes
s(thickness); } |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 // the draw operations will happen. | 493 // the draw operations will happen. |
494 struct CanvasSaveState; | 494 struct CanvasSaveState; |
495 Vector<CanvasSaveState> m_canvasStateStack; | 495 Vector<CanvasSaveState> m_canvasStateStack; |
496 bool m_pendingCanvasSave; | 496 bool m_pendingCanvasSave; |
497 | 497 |
498 AnnotationModeFlags m_annotationMode; | 498 AnnotationModeFlags m_annotationMode; |
499 | 499 |
500 struct RecordingState; | 500 struct RecordingState; |
501 Vector<RecordingState> m_recordingStateStack; | 501 Vector<RecordingState> m_recordingStateStack; |
502 | 502 |
503 #if ASSERT_ENABLED | 503 #if ENABLE(ASSERT) |
504 unsigned m_annotationCount; | 504 unsigned m_annotationCount; |
505 unsigned m_layerCount; | 505 unsigned m_layerCount; |
506 bool m_disableDestructionChecks; | 506 bool m_disableDestructionChecks; |
507 #endif | 507 #endif |
508 // Tracks the region painted opaque via the GraphicsContext. | 508 // Tracks the region painted opaque via the GraphicsContext. |
509 OpaqueRegionSkia m_opaqueRegion; | 509 OpaqueRegionSkia m_opaqueRegion; |
510 | 510 |
511 // Tracks the region where text is painted via the GraphicsContext. | 511 // Tracks the region where text is painted via the GraphicsContext. |
512 SkRect m_textRegion; | 512 SkRect m_textRegion; |
513 | 513 |
514 unsigned m_disabledState; | 514 unsigned m_disabledState; |
515 | 515 |
516 // Activation for the above region tracking features | 516 // Activation for the above region tracking features |
517 bool m_trackOpaqueRegion : 1; | 517 bool m_trackOpaqueRegion : 1; |
518 bool m_trackTextRegion : 1; | 518 bool m_trackTextRegion : 1; |
519 | 519 |
520 // Are we on a high DPI display? If so, spelling and grammar markers are lar
ger. | 520 // Are we on a high DPI display? If so, spelling and grammar markers are lar
ger. |
521 bool m_useHighResMarker : 1; | 521 bool m_useHighResMarker : 1; |
522 // FIXME: Make this go away: crbug.com/236892 | 522 // FIXME: Make this go away: crbug.com/236892 |
523 bool m_updatingControlTints : 1; | 523 bool m_updatingControlTints : 1; |
524 bool m_accelerated : 1; | 524 bool m_accelerated : 1; |
525 bool m_isCertainlyOpaque : 1; | 525 bool m_isCertainlyOpaque : 1; |
526 bool m_printing : 1; | 526 bool m_printing : 1; |
527 bool m_antialiasHairlineImages : 1; | 527 bool m_antialiasHairlineImages : 1; |
528 }; | 528 }; |
529 | 529 |
530 } // namespace WebCore | 530 } // namespace WebCore |
531 | 531 |
532 #endif // GraphicsContext_h | 532 #endif // GraphicsContext_h |
OLD | NEW |