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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 Color fillColor() const { return m_state->m_fillColor; } | 129 Color fillColor() const { return m_state->m_fillColor; } |
130 void setFillColor(const Color&); | 130 void setFillColor(const Color&); |
131 SkColor effectiveFillColor() const { return m_state->applyAlpha(m_state->m_f
illColor.rgb()); } | 131 SkColor effectiveFillColor() const { return m_state->applyAlpha(m_state->m_f
illColor.rgb()); } |
132 | 132 |
133 void setFillPattern(PassRefPtr<Pattern>); | 133 void setFillPattern(PassRefPtr<Pattern>); |
134 Pattern* fillPattern() const { return m_state->m_fillPattern.get(); } | 134 Pattern* fillPattern() const { return m_state->m_fillPattern.get(); } |
135 | 135 |
136 void setFillGradient(PassRefPtr<Gradient>); | 136 void setFillGradient(PassRefPtr<Gradient>); |
137 Gradient* fillGradient() const { return m_state->m_fillGradient.get(); } | 137 Gradient* fillGradient() const { return m_state->m_fillGradient.get(); } |
138 | 138 |
139 SkDrawLooper* drawLooper() const { return m_state->m_looper; } | 139 SkDrawLooper* drawLooper() const { return m_state->m_looper.get(); } |
140 SkColor effectiveStrokeColor() const { return m_state->applyAlpha(m_state->m
_strokeData.color().rgb()); } | 140 SkColor effectiveStrokeColor() const { return m_state->applyAlpha(m_state->m
_strokeData.color().rgb()); } |
141 | 141 |
142 int getNormalizedAlpha() const; | 142 int getNormalizedAlpha() const; |
143 | 143 |
144 bool getClipBounds(SkRect* bounds) const; | 144 bool getClipBounds(SkRect* bounds) const; |
145 const SkMatrix& getTotalMatrix() const; | 145 const SkMatrix& getTotalMatrix() const; |
146 bool isPrintingDevice() const; | 146 bool isPrintingDevice() const; |
147 | 147 |
148 void setShadowsIgnoreTransforms(bool ignoreTransforms) { m_state->m_shadowsI
gnoreTransforms = ignoreTransforms; } | 148 void setShadowsIgnoreTransforms(bool ignoreTransforms) { m_state->m_shadowsI
gnoreTransforms = ignoreTransforms; } |
149 bool shadowsIgnoreTransforms() const { return m_state->m_shadowsIgnoreTransf
orms; } | 149 bool shadowsIgnoreTransforms() const { return m_state->m_shadowsIgnoreTransf
orms; } |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 value = -value; | 387 value = -value; |
388 isNeg = true; | 388 isNeg = true; |
389 } | 389 } |
390 if (value >= max) | 390 if (value >= max) |
391 value %= max; | 391 value %= max; |
392 if (isNeg) | 392 if (isNeg) |
393 value = -value; | 393 value = -value; |
394 return value; | 394 return value; |
395 } | 395 } |
396 | 396 |
397 void setDrawLooper(SkDrawLooper* looper) { SkRefCnt_SafeAssign(m_state->m_lo
oper, looper); } | 397 void setDrawLooper(SkDrawLooper* looper) { m_state->m_looper = looper; } |
398 | 398 |
399 // Sets up the common flags on a paint for antialiasing, effects, etc. | 399 // Sets up the common flags on a paint for antialiasing, effects, etc. |
400 // This is implicitly called by setupPaintFill and setupPaintStroke, but | 400 // This is implicitly called by setupPaintFill and setupPaintStroke, but |
401 // you may wish to call it directly sometimes if you don't want that other | 401 // you may wish to call it directly sometimes if you don't want that other |
402 // behavior. | 402 // behavior. |
403 void setupPaintCommon(SkPaint*) const; | 403 void setupPaintCommon(SkPaint*) const; |
404 | 404 |
405 // Helpers for drawing a focus ring (drawFocusRing) | 405 // Helpers for drawing a focus ring (drawFocusRing) |
406 void drawOuterPath(const SkPath&, SkPaint&, int); | 406 void drawOuterPath(const SkPath&, SkPaint&, int); |
407 void drawInnerPath(const SkPath&, SkPaint&, int); | 407 void drawInnerPath(const SkPath&, SkPaint&, int); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 // FIXME: Make this go away: crbug.com/236892 | 469 // FIXME: Make this go away: crbug.com/236892 |
470 bool m_updatingControlTints : 1; | 470 bool m_updatingControlTints : 1; |
471 bool m_accelerated : 1; | 471 bool m_accelerated : 1; |
472 bool m_isCertainlyOpaque : 1; | 472 bool m_isCertainlyOpaque : 1; |
473 bool m_printing : 1; | 473 bool m_printing : 1; |
474 }; | 474 }; |
475 | 475 |
476 } // namespace WebCore | 476 } // namespace WebCore |
477 | 477 |
478 #endif // GraphicsContext_h | 478 #endif // GraphicsContext_h |
OLD | NEW |