OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. | 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. |
9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
10 * | 10 * |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 { | 821 { |
822 // See 4.8.11.1.3 Compositing | 822 // See 4.8.11.1.3 Compositing |
823 // CompositeSourceAtop and CompositeDestinationOut are not listed here as th
e platforms already | 823 // CompositeSourceAtop and CompositeDestinationOut are not listed here as th
e platforms already |
824 // implement the specification's behavior. | 824 // implement the specification's behavior. |
825 return op == SkXfermode::kSrcIn_Mode || op == SkXfermode::kSrcOut_Mode || op
== SkXfermode::kDstIn_Mode || op == SkXfermode::kDstATop_Mode; | 825 return op == SkXfermode::kSrcIn_Mode || op == SkXfermode::kSrcOut_Mode || op
== SkXfermode::kDstIn_Mode || op == SkXfermode::kDstATop_Mode; |
826 } | 826 } |
827 | 827 |
828 template<typename DrawFunc> | 828 template<typename DrawFunc> |
829 void CanvasRenderingContext2D::compositedDraw(const DrawFunc& drawFunc, SkCanvas
* c, CanvasRenderingContext2DState::PaintType paintType, CanvasRenderingContext2
DState::ImageType imageType) | 829 void CanvasRenderingContext2D::compositedDraw(const DrawFunc& drawFunc, SkCanvas
* c, CanvasRenderingContext2DState::PaintType paintType, CanvasRenderingContext2
DState::ImageType imageType) |
830 { | 830 { |
831 SkImageFilter* filter = state().getFilter(canvas(), accessFont()); | 831 SkImageFilter* filter = state().getFilter(canvas(), accessFont(), canvas()->
size()); |
832 ASSERT(isFullCanvasCompositeMode(state().globalComposite()) || filter); | 832 ASSERT(isFullCanvasCompositeMode(state().globalComposite()) || filter); |
833 SkMatrix ctm = c->getTotalMatrix(); | 833 SkMatrix ctm = c->getTotalMatrix(); |
834 c->resetMatrix(); | 834 c->resetMatrix(); |
835 SkPaint compositePaint; | 835 SkPaint compositePaint; |
836 compositePaint.setXfermodeMode(state().globalComposite()); | 836 compositePaint.setXfermodeMode(state().globalComposite()); |
837 if (state().shouldDrawShadows()) { | 837 if (state().shouldDrawShadows()) { |
838 // unroll into two independently composited passes if drawing shadows | 838 // unroll into two independently composited passes if drawing shadows |
839 SkPaint shadowPaint = *state().getPaint(paintType, DrawShadowOnly, image
Type); | 839 SkPaint shadowPaint = *state().getPaint(paintType, DrawShadowOnly, image
Type); |
840 int saveCount = c->getSaveCount(); | 840 int saveCount = c->getSaveCount(); |
841 if (filter) { | 841 if (filter) { |
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2328 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) | 2328 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) |
2329 return; | 2329 return; |
2330 if (alpha < 0xFF) | 2330 if (alpha < 0xFF) |
2331 return; | 2331 return; |
2332 } | 2332 } |
2333 | 2333 |
2334 canvas()->buffer()->willOverwriteCanvas(); | 2334 canvas()->buffer()->willOverwriteCanvas(); |
2335 } | 2335 } |
2336 | 2336 |
2337 } // namespace blink | 2337 } // namespace blink |
OLD | NEW |