| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 void setRegionTrackingMode(RegionTrackingMode); | 210 void setRegionTrackingMode(RegionTrackingMode); |
| 211 bool regionTrackingEnabled() { return m_regionTrackingMode != RegionTracking
Disabled; } | 211 bool regionTrackingEnabled() { return m_regionTrackingMode != RegionTracking
Disabled; } |
| 212 const RegionTracker& opaqueRegion() const { return m_trackedRegion; } | 212 const RegionTracker& opaqueRegion() const { return m_trackedRegion; } |
| 213 | 213 |
| 214 // The text region is empty until tracking is turned on. | 214 // The text region is empty until tracking is turned on. |
| 215 // It is never clerared by the context. | 215 // It is never clerared by the context. |
| 216 void setTrackTextRegion(bool track) { m_trackTextRegion = track; } | 216 void setTrackTextRegion(bool track) { m_trackTextRegion = track; } |
| 217 const SkRect& textRegion() const { return m_textRegion; } | 217 const SkRect& textRegion() const { return m_textRegion; } |
| 218 | 218 |
| 219 SkColorFilter* colorFilter() const; | 219 SkColorFilter* colorFilter() const; |
| 220 void setColorFilter(ColorFilter); | 220 void setColorFilter(ColorFilterObsolete); |
| 221 // ---------- End state management methods ----------------- | 221 // ---------- End state management methods ----------------- |
| 222 | 222 |
| 223 // Get the contents of the image buffer | 223 // Get the contents of the image buffer |
| 224 bool readPixels(const SkImageInfo&, void* pixels, size_t rowBytes, int x, in
t y); | 224 bool readPixels(const SkImageInfo&, void* pixels, size_t rowBytes, int x, in
t y); |
| 225 | 225 |
| 226 // Get the current fill style. | 226 // Get the current fill style. |
| 227 const SkPaint& fillPaint() const { return immutableState()->fillPaint(); } | 227 const SkPaint& fillPaint() const { return immutableState()->fillPaint(); } |
| 228 | 228 |
| 229 // Get the current stroke style. | 229 // Get the current stroke style. |
| 230 const SkPaint& strokePaint() const { return immutableState()->strokePaint();
} | 230 const SkPaint& strokePaint() const { return immutableState()->strokePaint();
} |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 void drawHighlightForText(const Font&, const TextRun&, const FloatPoint&, in
t h, const Color& backgroundColor, int from = 0, int to = -1); | 309 void drawHighlightForText(const Font&, const TextRun&, const FloatPoint&, in
t h, const Color& backgroundColor, int from = 0, int to = -1); |
| 310 | 310 |
| 311 void drawLineForText(const FloatPoint&, float width); | 311 void drawLineForText(const FloatPoint&, float width); |
| 312 enum DocumentMarkerLineStyle { | 312 enum DocumentMarkerLineStyle { |
| 313 DocumentMarkerSpellingLineStyle, | 313 DocumentMarkerSpellingLineStyle, |
| 314 DocumentMarkerGrammarLineStyle | 314 DocumentMarkerGrammarLineStyle |
| 315 }; | 315 }; |
| 316 void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarke
rLineStyle); | 316 void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarke
rLineStyle); |
| 317 | 317 |
| 318 void beginTransparencyLayer(float opacity, const FloatRect* = 0); | 318 void beginTransparencyLayer(float opacity, const FloatRect* = 0); |
| 319 void beginLayer(float opacity, CompositeOperator, const FloatRect* = 0, Colo
rFilter = ColorFilterNone, ImageFilter* = 0); | 319 void beginLayer(float opacity, CompositeOperator, const FloatRect* = 0, Colo
rFilterObsolete = ColorFilterNone, ImageFilter* = 0); |
| 320 void endLayer(); | 320 void endLayer(); |
| 321 | 321 |
| 322 bool hasShadow() const; | 322 bool hasShadow() const; |
| 323 void setShadow(const FloatSize& offset, float blur, const Color&, | 323 void setShadow(const FloatSize& offset, float blur, const Color&, |
| 324 DrawLooperBuilder::ShadowTransformMode = DrawLooperBuilder::ShadowRespec
tsTransforms, | 324 DrawLooperBuilder::ShadowTransformMode = DrawLooperBuilder::ShadowRespec
tsTransforms, |
| 325 DrawLooperBuilder::ShadowAlphaMode = DrawLooperBuilder::ShadowRespectsAl
pha); | 325 DrawLooperBuilder::ShadowAlphaMode = DrawLooperBuilder::ShadowRespectsAl
pha); |
| 326 void clearShadow() { clearDrawLooper(); } | 326 void clearShadow() { clearDrawLooper(); } |
| 327 | 327 |
| 328 // It is assumed that this draw looper is used only for shadows | 328 // It is assumed that this draw looper is used only for shadows |
| 329 // (i.e. a draw looper is set if and only if there is a shadow). | 329 // (i.e. a draw looper is set if and only if there is a shadow). |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 | 398 |
| 399 GraphicsContextState* mutableState() | 399 GraphicsContextState* mutableState() |
| 400 { | 400 { |
| 401 realizePaintSave(); | 401 realizePaintSave(); |
| 402 return m_paintState; | 402 return m_paintState; |
| 403 } | 403 } |
| 404 | 404 |
| 405 static void setPathFromConvexPoints(SkPath*, size_t, const FloatPoint*); | 405 static void setPathFromConvexPoints(SkPath*, size_t, const FloatPoint*); |
| 406 static void setRadii(SkVector*, IntSize, IntSize, IntSize, IntSize); | 406 static void setRadii(SkVector*, IntSize, IntSize, IntSize, IntSize); |
| 407 | 407 |
| 408 static PassRefPtr<SkColorFilter> WebCoreColorFilterToSkiaColorFilter(ColorFi
lter); | 408 static PassRefPtr<SkColorFilter> WebCoreColorFilterToSkiaColorFilter(ColorFi
lterObsolete); |
| 409 | 409 |
| 410 static inline int focusRingOutset(int offset) { return 0; } | 410 static inline int focusRingOutset(int offset) { return 0; } |
| 411 static inline int focusRingWidth(int width) { return 1; } | 411 static inline int focusRingWidth(int width) { return 1; } |
| 412 static SkPMColor lineColors(int); | 412 static SkPMColor lineColors(int); |
| 413 static SkPMColor antiColors1(int); | 413 static SkPMColor antiColors1(int); |
| 414 static SkPMColor antiColors2(int); | 414 static SkPMColor antiColors2(int); |
| 415 static void draw1xMarker(SkBitmap*, int); | 415 static void draw1xMarker(SkBitmap*, int); |
| 416 static void draw2xMarker(SkBitmap*, int); | 416 static void draw2xMarker(SkBitmap*, int); |
| 417 | 417 |
| 418 // Helpers for drawing a focus ring (drawFocusRing) | 418 // Helpers for drawing a focus ring (drawFocusRing) |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 | 500 |
| 501 bool m_accelerated : 1; | 501 bool m_accelerated : 1; |
| 502 bool m_isCertainlyOpaque : 1; | 502 bool m_isCertainlyOpaque : 1; |
| 503 bool m_antialiasHairlineImages : 1; | 503 bool m_antialiasHairlineImages : 1; |
| 504 bool m_shouldSmoothFonts : 1; | 504 bool m_shouldSmoothFonts : 1; |
| 505 }; | 505 }; |
| 506 | 506 |
| 507 } // namespace blink | 507 } // namespace blink |
| 508 | 508 |
| 509 #endif // SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSCONTEXT_H_ | 509 #endif // SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSCONTEXT_H_ |
| OLD | NEW |