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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 // needed in some other way. | 105 // needed in some other way. |
| 106 // See bug# 372110 | 106 // See bug# 372110 |
| 107 bool isRecordingCanvas() const | 107 bool isRecordingCanvas() const |
| 108 { | 108 { |
| 109 return m_canvas->imageInfo().colorType() == kUnknown_SkColorType; | 109 return m_canvas->imageInfo().colorType() == kUnknown_SkColorType; |
| 110 } | 110 } |
| 111 | 111 |
| 112 // ---------- State management methods ----------------- | 112 // ---------- State management methods ----------------- |
| 113 void save(); | 113 void save(); |
| 114 void restore(); | 114 void restore(); |
| 115 void unwindStateStack(); | |
| 116 #if !ASSERT_DISABLED | |
| 117 unsigned saveCount() { return m_saveCount; } | |
|
f(malita)
2014/05/27 20:28:22
return m_canvasStateStack.size()?
| |
| 118 void disableDestructionChecks() { m_disableDestructionChecks = true; } | |
| 119 #endif | |
| 115 | 120 |
| 116 void saveLayer(const SkRect* bounds, const SkPaint*); | 121 void saveLayer(const SkRect* bounds, const SkPaint*); |
| 117 void restoreLayer(); | 122 void restoreLayer(); |
| 118 | 123 |
| 119 float strokeThickness() const { return immutableState()->strokeData().thickn ess(); } | 124 float strokeThickness() const { return immutableState()->strokeData().thickn ess(); } |
| 120 void setStrokeThickness(float thickness) { mutableState()->setStrokeThicknes s(thickness); } | 125 void setStrokeThickness(float thickness) { mutableState()->setStrokeThicknes s(thickness); } |
| 121 | 126 |
| 122 StrokeStyle strokeStyle() const { return immutableState()->strokeData().styl e(); } | 127 StrokeStyle strokeStyle() const { return immutableState()->strokeData().styl e(); } |
| 123 void setStrokeStyle(StrokeStyle style) { mutableState()->setStrokeStyle(styl e); } | 128 void setStrokeStyle(StrokeStyle style) { mutableState()->setStrokeStyle(styl e); } |
| 124 | 129 |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 506 bool m_pendingCanvasSave; | 511 bool m_pendingCanvasSave; |
| 507 | 512 |
| 508 AnnotationModeFlags m_annotationMode; | 513 AnnotationModeFlags m_annotationMode; |
| 509 | 514 |
| 510 struct RecordingState; | 515 struct RecordingState; |
| 511 Vector<RecordingState> m_recordingStateStack; | 516 Vector<RecordingState> m_recordingStateStack; |
| 512 | 517 |
| 513 #if !ASSERT_DISABLED | 518 #if !ASSERT_DISABLED |
| 514 unsigned m_annotationCount; | 519 unsigned m_annotationCount; |
| 515 unsigned m_layerCount; | 520 unsigned m_layerCount; |
| 521 unsigned m_saveCount; | |
|
f(malita)
2014/05/27 20:28:22
Can we use m_canvasStateStack.size() instead?
Justin Novosad
2014/05/27 22:25:25
I guess. I am being prematurely concerned about in
| |
| 522 bool m_disableDestructionChecks; | |
| 516 #endif | 523 #endif |
| 517 // Tracks the region painted opaque via the GraphicsContext. | 524 // Tracks the region painted opaque via the GraphicsContext. |
| 518 OpaqueRegionSkia m_opaqueRegion; | 525 OpaqueRegionSkia m_opaqueRegion; |
| 519 | 526 |
| 520 // Tracks the region where text is painted via the GraphicsContext. | 527 // Tracks the region where text is painted via the GraphicsContext. |
| 521 SkRect m_textRegion; | 528 SkRect m_textRegion; |
| 522 | 529 |
| 523 unsigned m_disabledState; | 530 unsigned m_disabledState; |
| 524 | 531 |
| 525 // Activation for the above region tracking features | 532 // Activation for the above region tracking features |
| 526 bool m_trackOpaqueRegion : 1; | 533 bool m_trackOpaqueRegion : 1; |
| 527 bool m_trackTextRegion : 1; | 534 bool m_trackTextRegion : 1; |
| 528 | 535 |
| 529 // Are we on a high DPI display? If so, spelling and grammar markers are lar ger. | 536 // Are we on a high DPI display? If so, spelling and grammar markers are lar ger. |
| 530 bool m_useHighResMarker : 1; | 537 bool m_useHighResMarker : 1; |
| 531 // FIXME: Make this go away: crbug.com/236892 | 538 // FIXME: Make this go away: crbug.com/236892 |
| 532 bool m_updatingControlTints : 1; | 539 bool m_updatingControlTints : 1; |
| 533 bool m_accelerated : 1; | 540 bool m_accelerated : 1; |
| 534 bool m_isCertainlyOpaque : 1; | 541 bool m_isCertainlyOpaque : 1; |
| 535 bool m_printing : 1; | 542 bool m_printing : 1; |
| 536 bool m_antialiasHairlineImages : 1; | 543 bool m_antialiasHairlineImages : 1; |
| 537 }; | 544 }; |
| 538 | 545 |
| 539 } // namespace WebCore | 546 } // namespace WebCore |
| 540 | 547 |
| 541 #endif // GraphicsContext_h | 548 #endif // GraphicsContext_h |
| OLD | NEW |