| 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 "core/platform/chromium/TraceEvent.h" | 31 #include "core/platform/chromium/TraceEvent.h" |
| 32 #include "core/platform/graphics/DashArray.h" | 32 #include "core/platform/graphics/DashArray.h" |
| 33 #include "core/platform/graphics/DrawLooper.h" | 33 #include "core/platform/graphics/DrawLooper.h" |
| 34 #include "core/platform/graphics/FloatRect.h" | 34 #include "core/platform/graphics/FloatRect.h" |
| 35 #include "core/platform/graphics/Font.h" | 35 #include "core/platform/graphics/Font.h" |
| 36 #include "core/platform/graphics/GraphicsContextAnnotation.h" | 36 #include "core/platform/graphics/GraphicsContextAnnotation.h" |
| 37 #include "core/platform/graphics/GraphicsContextState.h" | 37 #include "core/platform/graphics/GraphicsContextState.h" |
| 38 #include "core/platform/graphics/ImageBuffer.h" | 38 #include "core/platform/graphics/ImageBuffer.h" |
| 39 #include "core/platform/graphics/ImageOrientation.h" | 39 #include "core/platform/graphics/ImageOrientation.h" |
| 40 #include "core/platform/graphics/skia/OpaqueRegionSkia.h" | 40 #include "core/platform/graphics/skia/OpaqueRegionSkia.h" |
| 41 | 41 #include "wtf/FastAllocBase.h" |
| 42 #include <wtf/Noncopyable.h> | 42 #include "wtf/Forward.h" |
| 43 #include <wtf/PassOwnPtr.h> | 43 #include "wtf/Noncopyable.h" |
| 44 #include "wtf/PassOwnPtr.h" |
| 44 | 45 |
| 45 class SkBitmap; | 46 class SkBitmap; |
| 46 class SkDevice; | 47 class SkDevice; |
| 47 class SkPaint; | 48 class SkPaint; |
| 48 class SkPath; | 49 class SkPath; |
| 49 class SkRRect; | 50 class SkRRect; |
| 50 struct SkRect; | 51 struct SkRect; |
| 51 | 52 |
| 52 namespace WebCore { | 53 namespace WebCore { |
| 53 | 54 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 Color fillColor() const { return m_state->m_fillColor; } | 121 Color fillColor() const { return m_state->m_fillColor; } |
| 121 void setFillColor(const Color&); | 122 void setFillColor(const Color&); |
| 122 SkColor effectiveFillColor() const { return m_state->applyAlpha(m_state->m_f
illColor.rgb()); } | 123 SkColor effectiveFillColor() const { return m_state->applyAlpha(m_state->m_f
illColor.rgb()); } |
| 123 | 124 |
| 124 void setFillPattern(PassRefPtr<Pattern>); | 125 void setFillPattern(PassRefPtr<Pattern>); |
| 125 Pattern* fillPattern() const { return m_state->m_fillPattern.get(); } | 126 Pattern* fillPattern() const { return m_state->m_fillPattern.get(); } |
| 126 | 127 |
| 127 void setFillGradient(PassRefPtr<Gradient>); | 128 void setFillGradient(PassRefPtr<Gradient>); |
| 128 Gradient* fillGradient() const { return m_state->m_fillGradient.get(); } | 129 Gradient* fillGradient() const { return m_state->m_fillGradient.get(); } |
| 129 | 130 |
| 130 SkDrawLooper* drawLooper() const { return m_state->m_looper; } | 131 SkDrawLooper* drawLooper() const { return m_state->m_looper.get(); } |
| 131 SkColor effectiveStrokeColor() const { return m_state->applyAlpha(m_state->m
_strokeData.color().rgb()); } | 132 SkColor effectiveStrokeColor() const { return m_state->applyAlpha(m_state->m
_strokeData.color().rgb()); } |
| 132 | 133 |
| 133 int getNormalizedAlpha() const; | 134 int getNormalizedAlpha() const; |
| 134 | 135 |
| 135 bool getClipBounds(SkRect* bounds) const; | 136 bool getClipBounds(SkRect* bounds) const; |
| 136 const SkMatrix& getTotalMatrix() const; | 137 const SkMatrix& getTotalMatrix() const; |
| 137 bool isPrintingDevice() const; | 138 bool isPrintingDevice() const; |
| 138 | 139 |
| 139 void setShouldAntialias(bool antialias) { m_state->m_shouldAntialias = antia
lias; } | 140 void setShouldAntialias(bool antialias) { m_state->m_shouldAntialias = antia
lias; } |
| 140 bool shouldAntialias() const { return m_state->m_shouldAntialias; } | 141 bool shouldAntialias() const { return m_state->m_shouldAntialias; } |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 value = -value; | 382 value = -value; |
| 382 isNeg = true; | 383 isNeg = true; |
| 383 } | 384 } |
| 384 if (value >= max) | 385 if (value >= max) |
| 385 value %= max; | 386 value %= max; |
| 386 if (isNeg) | 387 if (isNeg) |
| 387 value = -value; | 388 value = -value; |
| 388 return value; | 389 return value; |
| 389 } | 390 } |
| 390 | 391 |
| 391 void setDrawLooper(SkDrawLooper* looper) { SkRefCnt_SafeAssign(m_state->m_lo
oper, looper); } | |
| 392 | |
| 393 // Sets up the common flags on a paint for antialiasing, effects, etc. | 392 // Sets up the common flags on a paint for antialiasing, effects, etc. |
| 394 // This is implicitly called by setupPaintFill and setupPaintStroke, but | 393 // This is implicitly called by setupPaintFill and setupPaintStroke, but |
| 395 // you may wish to call it directly sometimes if you don't want that other | 394 // you may wish to call it directly sometimes if you don't want that other |
| 396 // behavior. | 395 // behavior. |
| 397 void setupPaintCommon(SkPaint*) const; | 396 void setupPaintCommon(SkPaint*) const; |
| 398 | 397 |
| 399 // Helpers for drawing a focus ring (drawFocusRing) | 398 // Helpers for drawing a focus ring (drawFocusRing) |
| 400 void drawOuterPath(const SkPath&, SkPaint&, int); | 399 void drawOuterPath(const SkPath&, SkPaint&, int); |
| 401 void drawInnerPath(const SkPath&, SkPaint&, int); | 400 void drawInnerPath(const SkPath&, SkPaint&, int); |
| 402 | 401 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 // FIXME: Make this go away: crbug.com/236892 | 464 // FIXME: Make this go away: crbug.com/236892 |
| 466 bool m_updatingControlTints : 1; | 465 bool m_updatingControlTints : 1; |
| 467 bool m_accelerated : 1; | 466 bool m_accelerated : 1; |
| 468 bool m_isCertainlyOpaque : 1; | 467 bool m_isCertainlyOpaque : 1; |
| 469 bool m_printing : 1; | 468 bool m_printing : 1; |
| 470 }; | 469 }; |
| 471 | 470 |
| 472 } // namespace WebCore | 471 } // namespace WebCore |
| 473 | 472 |
| 474 #endif // GraphicsContext_h | 473 #endif // GraphicsContext_h |
| OLD | NEW |