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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 // It is never clerared by the context. | 230 // It is never clerared by the context. |
| 231 void setTrackTextRegion(bool track) { m_trackTextRegion = track; } | 231 void setTrackTextRegion(bool track) { m_trackTextRegion = track; } |
| 232 const SkRect& textRegion() const { return m_textRegion; } | 232 const SkRect& textRegion() const { return m_textRegion; } |
| 233 | 233 |
| 234 bool updatingControlTints() const { return m_updatingControlTints; } | 234 bool updatingControlTints() const { return m_updatingControlTints; } |
| 235 void setUpdatingControlTints(bool updatingTints) { m_updatingControlTints = updatingTints; } | 235 void setUpdatingControlTints(bool updatingTints) { m_updatingControlTints = updatingTints; } |
| 236 | 236 |
| 237 AnnotationModeFlags annotationMode() const { return m_annotationMode; } | 237 AnnotationModeFlags annotationMode() const { return m_annotationMode; } |
| 238 void setAnnotationMode(const AnnotationModeFlags mode) { m_annotationMode = mode; } | 238 void setAnnotationMode(const AnnotationModeFlags mode) { m_annotationMode = mode; } |
| 239 | 239 |
| 240 SkColorFilter* colorFilter(); | 240 SkColorFilter* colorFilter() const; |
| 241 void setColorFilter(ColorFilter); | 241 void setColorFilter(ColorFilter); |
| 242 // ---------- End state management methods ----------------- | 242 // ---------- End state management methods ----------------- |
| 243 | 243 |
| 244 // Get the contents of the image buffer | 244 // Get the contents of the image buffer |
| 245 bool readPixels(const SkImageInfo&, void* pixels, size_t rowBytes, int x, in t y); | 245 bool readPixels(const SkImageInfo&, void* pixels, size_t rowBytes, int x, in t y); |
| 246 | 246 |
| 247 // Get the current fill style. | 247 // Get the current fill style. |
| 248 const SkPaint& fillPaint() const { return immutableState()->fillPaint(); } | 248 const SkPaint& fillPaint() const { return immutableState()->fillPaint(); } |
| 249 | 249 |
| 250 // Get the current stroke style. | 250 // Get the current stroke style. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 404 | 404 |
| 405 // Create an image buffer compatible with this context, with suitable resolu tion | 405 // Create an image buffer compatible with this context, with suitable resolu tion |
| 406 // for drawing into the buffer and then into this context. | 406 // for drawing into the buffer and then into this context. |
| 407 PassOwnPtr<ImageBuffer> createRasterBuffer(const IntSize&, OpacityMode = Non Opaque) const; | 407 PassOwnPtr<ImageBuffer> createRasterBuffer(const IntSize&, OpacityMode = Non Opaque) const; |
| 408 | 408 |
| 409 static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, floa t strokeWidth, StrokeStyle); | 409 static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, floa t strokeWidth, StrokeStyle); |
| 410 | 410 |
| 411 void beginAnnotation(const AnnotationList&); | 411 void beginAnnotation(const AnnotationList&); |
| 412 void endAnnotation(); | 412 void endAnnotation(); |
| 413 | 413 |
| 414 void preparePaint( | |
|
jbroman
2014/07/23 15:48:59
drive-by: please use a more descriptive name than
Rémi Piotaix
2014/07/23 17:28:22
Done.
| |
| 415 SkPaint*, | |
| 416 const SkRect& srcRect, | |
| 417 const SkRect& destRect, | |
| 418 CompositeOperator, | |
| 419 blink::WebBlendMode, | |
| 420 bool isLazyDecoded = false) const; | |
| 414 private: | 421 private: |
| 415 const GraphicsContextState* immutableState() const { return m_paintState; } | 422 const GraphicsContextState* immutableState() const { return m_paintState; } |
| 416 | 423 |
| 417 GraphicsContextState* mutableState() | 424 GraphicsContextState* mutableState() |
| 418 { | 425 { |
| 419 realizePaintSave(); | 426 realizePaintSave(); |
| 420 return m_paintState; | 427 return m_paintState; |
| 421 } | 428 } |
| 422 | 429 |
| 423 static void setPathFromConvexPoints(SkPath*, size_t, const FloatPoint*); | 430 static void setPathFromConvexPoints(SkPath*, size_t, const FloatPoint*); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 529 bool m_updatingControlTints : 1; | 536 bool m_updatingControlTints : 1; |
| 530 bool m_accelerated : 1; | 537 bool m_accelerated : 1; |
| 531 bool m_isCertainlyOpaque : 1; | 538 bool m_isCertainlyOpaque : 1; |
| 532 bool m_printing : 1; | 539 bool m_printing : 1; |
| 533 bool m_antialiasHairlineImages : 1; | 540 bool m_antialiasHairlineImages : 1; |
| 534 }; | 541 }; |
| 535 | 542 |
| 536 } // namespace blink | 543 } // namespace blink |
| 537 | 544 |
| 538 #endif // GraphicsContext_h | 545 #endif // GraphicsContext_h |
| OLD | NEW |