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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 SkColor effectiveFillColor() const { return immutableState()->effectiveFillC olor(); } | 129 SkColor effectiveFillColor() const { return immutableState()->effectiveFillC olor(); } |
| 130 | 130 |
| 131 void setFillPattern(PassRefPtr<Pattern>); | 131 void setFillPattern(PassRefPtr<Pattern>); |
| 132 Pattern* fillPattern() const { return immutableState()->fillPattern(); } | 132 Pattern* fillPattern() const { return immutableState()->fillPattern(); } |
| 133 | 133 |
| 134 void setFillGradient(PassRefPtr<Gradient>); | 134 void setFillGradient(PassRefPtr<Gradient>); |
| 135 Gradient* fillGradient() const { return immutableState()->fillGradient(); } | 135 Gradient* fillGradient() const { return immutableState()->fillGradient(); } |
| 136 | 136 |
| 137 SkDrawLooper* drawLooper() const { return immutableState()->drawLooper(); } | 137 SkDrawLooper* drawLooper() const { return immutableState()->drawLooper(); } |
| 138 | 138 |
| 139 SkImageFilter* imageFilter() const { return immutableState()->imageFilter(); } | |
| 140 | |
| 139 bool getTransformedClipBounds(FloatRect* bounds) const; | 141 bool getTransformedClipBounds(FloatRect* bounds) const; |
| 140 SkMatrix getTotalMatrix() const; | 142 SkMatrix getTotalMatrix() const; |
| 141 | 143 |
| 142 void setShouldAntialias(bool antialias) { mutableState()->setShouldAntialias (antialias); } | 144 void setShouldAntialias(bool antialias) { mutableState()->setShouldAntialias (antialias); } |
| 143 bool shouldAntialias() const { return immutableState()->shouldAntialias(); } | 145 bool shouldAntialias() const { return immutableState()->shouldAntialias(); } |
| 144 | 146 |
| 145 // Disable the anti-aliasing optimization for scales/multiple-of-90-degrees | 147 // Disable the anti-aliasing optimization for scales/multiple-of-90-degrees |
| 146 // rotations of thin ("hairline") images. | 148 // rotations of thin ("hairline") images. |
| 147 // Note: This will only be reliable when the device pixel scale/ratio is | 149 // Note: This will only be reliable when the device pixel scale/ratio is |
| 148 // fixed (e.g. when drawing to context backed by an ImageBuffer). | 150 // fixed (e.g. when drawing to context backed by an ImageBuffer). |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 343 DrawLooperBuilder::ShadowTransformMode = DrawLooperBuilder::ShadowRespec tsTransforms, | 345 DrawLooperBuilder::ShadowTransformMode = DrawLooperBuilder::ShadowRespec tsTransforms, |
| 344 DrawLooperBuilder::ShadowAlphaMode = DrawLooperBuilder::ShadowRespectsAl pha, ShadowMode = DrawShadowAndForeground); | 346 DrawLooperBuilder::ShadowAlphaMode = DrawLooperBuilder::ShadowRespectsAl pha, ShadowMode = DrawShadowAndForeground); |
| 345 void clearShadow() { clearDrawLooper(); } | 347 void clearShadow() { clearDrawLooper(); } |
| 346 | 348 |
| 347 // It is assumed that this draw looper is used only for shadows | 349 // It is assumed that this draw looper is used only for shadows |
| 348 // (i.e. a draw looper is set if and only if there is a shadow). | 350 // (i.e. a draw looper is set if and only if there is a shadow). |
| 349 // The builder passed into this method will be destroyed. | 351 // The builder passed into this method will be destroyed. |
| 350 void setDrawLooper(PassOwnPtr<DrawLooperBuilder>); | 352 void setDrawLooper(PassOwnPtr<DrawLooperBuilder>); |
| 351 void clearDrawLooper(); | 353 void clearDrawLooper(); |
| 352 | 354 |
| 355 // It is assumed that this image filter is used only for shadows | |
| 356 // (i.e. an image filter is set if and only if there is a shadow). | |
| 357 void setImageFilter(PassRefPtr<SkImageFilter>); | |
|
Stephen White
2014/10/23 01:45:47
Make these private?
Justin Novosad
2014/10/23 02:29:21
Yes, and while you are at it, make the drawLooper
sugoi1
2014/10/23 17:43:17
Can't, they're also use for text shadows.
sugoi1
2014/10/23 17:43:17
Done.
| |
| 358 void clearImageFilter(); | |
| 359 | |
| 353 void drawFocusRing(const Vector<IntRect>&, int width, int offset, const Colo r&); | 360 void drawFocusRing(const Vector<IntRect>&, int width, int offset, const Colo r&); |
| 354 void drawFocusRing(const Path&, int width, int offset, const Color&); | 361 void drawFocusRing(const Path&, int width, int offset, const Color&); |
| 355 | 362 |
| 356 enum Edge { | 363 enum Edge { |
| 357 NoEdge = 0, | 364 NoEdge = 0, |
| 358 TopEdge = 1 << 1, | 365 TopEdge = 1 << 1, |
| 359 RightEdge = 1 << 2, | 366 RightEdge = 1 << 2, |
| 360 BottomEdge = 1 << 3, | 367 BottomEdge = 1 << 3, |
| 361 LeftEdge = 1 << 4 | 368 LeftEdge = 1 << 4 |
| 362 }; | 369 }; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 394 | 401 |
| 395 void beginAnnotation(const AnnotationList&); | 402 void beginAnnotation(const AnnotationList&); |
| 396 void endAnnotation(); | 403 void endAnnotation(); |
| 397 | 404 |
| 398 void preparePaintForDrawRectToRect( | 405 void preparePaintForDrawRectToRect( |
| 399 SkPaint*, | 406 SkPaint*, |
| 400 const SkRect& srcRect, | 407 const SkRect& srcRect, |
| 401 const SkRect& destRect, | 408 const SkRect& destRect, |
| 402 CompositeOperator, | 409 CompositeOperator, |
| 403 WebBlendMode, | 410 WebBlendMode, |
| 411 bool isOpaque, | |
| 404 bool isLazyDecoded = false, | 412 bool isLazyDecoded = false, |
| 405 bool isDataComplete = true) const; | 413 bool isDataComplete = true) const; |
| 406 | 414 |
| 407 static int focusRingOutsetExtent(int offset, int width) | 415 static int focusRingOutsetExtent(int offset, int width) |
| 408 { | 416 { |
| 409 return focusRingOutset(offset) + (focusRingWidth(width) + 1) / 2; | 417 return focusRingOutset(offset) + (focusRingWidth(width) + 1) / 2; |
| 410 } | 418 } |
| 411 | 419 |
| 412 private: | 420 private: |
| 413 const GraphicsContextState* immutableState() const { return m_paintState; } | 421 const GraphicsContextState* immutableState() const { return m_paintState; } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 515 bool m_accelerated : 1; | 523 bool m_accelerated : 1; |
| 516 bool m_isCertainlyOpaque : 1; | 524 bool m_isCertainlyOpaque : 1; |
| 517 bool m_printing : 1; | 525 bool m_printing : 1; |
| 518 bool m_antialiasHairlineImages : 1; | 526 bool m_antialiasHairlineImages : 1; |
| 519 bool m_shouldSmoothFonts : 1; | 527 bool m_shouldSmoothFonts : 1; |
| 520 }; | 528 }; |
| 521 | 529 |
| 522 } // namespace blink | 530 } // namespace blink |
| 523 | 531 |
| 524 #endif // GraphicsContext_h | 532 #endif // GraphicsContext_h |
| OLD | NEW |