| 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 27 matching lines...) Expand all Loading... |
| 38 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 38 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 39 #include "core/CSSPropertyNames.h" | 39 #include "core/CSSPropertyNames.h" |
| 40 #include "core/css/StylePropertySet.h" | 40 #include "core/css/StylePropertySet.h" |
| 41 #include "core/css/parser/CSSParser.h" | 41 #include "core/css/parser/CSSParser.h" |
| 42 #include "core/css/resolver/StyleResolver.h" | 42 #include "core/css/resolver/StyleResolver.h" |
| 43 #include "core/dom/AXObjectCache.h" | 43 #include "core/dom/AXObjectCache.h" |
| 44 #include "core/dom/StyleEngine.h" | 44 #include "core/dom/StyleEngine.h" |
| 45 #include "core/events/Event.h" | 45 #include "core/events/Event.h" |
| 46 #include "core/frame/ImageBitmap.h" | 46 #include "core/frame/ImageBitmap.h" |
| 47 #include "core/frame/Settings.h" | 47 #include "core/frame/Settings.h" |
| 48 #include "core/frame/UseCounter.h" | |
| 49 #include "core/html/HTMLVideoElement.h" | 48 #include "core/html/HTMLVideoElement.h" |
| 50 #include "core/html/ImageData.h" | 49 #include "core/html/ImageData.h" |
| 51 #include "core/html/TextMetrics.h" | 50 #include "core/html/TextMetrics.h" |
| 52 #include "core/html/canvas/CanvasFontCache.h" | 51 #include "core/html/canvas/CanvasFontCache.h" |
| 53 #include "core/layout/LayoutBox.h" | 52 #include "core/layout/LayoutBox.h" |
| 54 #include "core/layout/LayoutTheme.h" | 53 #include "core/layout/LayoutTheme.h" |
| 55 #include "modules/canvas2d/CanvasGradient.h" | 54 #include "modules/canvas2d/CanvasGradient.h" |
| 56 #include "modules/canvas2d/CanvasPattern.h" | 55 #include "modules/canvas2d/CanvasPattern.h" |
| 57 #include "modules/canvas2d/CanvasRenderingContext2DState.h" | 56 #include "modules/canvas2d/CanvasRenderingContext2DState.h" |
| 58 #include "modules/canvas2d/CanvasStyle.h" | 57 #include "modules/canvas2d/CanvasStyle.h" |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 | 622 |
| 624 String CanvasRenderingContext2D::globalCompositeOperation() const | 623 String CanvasRenderingContext2D::globalCompositeOperation() const |
| 625 { | 624 { |
| 626 return compositeOperatorName(compositeOperatorFromSkia(state().globalComposi
te()), blendModeFromSkia(state().globalComposite())); | 625 return compositeOperatorName(compositeOperatorFromSkia(state().globalComposi
te()), blendModeFromSkia(state().globalComposite())); |
| 627 } | 626 } |
| 628 | 627 |
| 629 void CanvasRenderingContext2D::setGlobalCompositeOperation(const String& operati
on) | 628 void CanvasRenderingContext2D::setGlobalCompositeOperation(const String& operati
on) |
| 630 { | 629 { |
| 631 CompositeOperator op = CompositeSourceOver; | 630 CompositeOperator op = CompositeSourceOver; |
| 632 WebBlendMode blendMode = WebBlendModeNormal; | 631 WebBlendMode blendMode = WebBlendModeNormal; |
| 633 // TODO(dshwang): Support nonstandard "darker" until M43. crbug.com/425628 | 632 if (!parseCompositeAndBlendOperator(operation, op, blendMode)) |
| 634 String operationName = operation; | |
| 635 if (operation == "darker") { | |
| 636 operationName = "darken"; | |
| 637 if (canvas()) | |
| 638 UseCounter::countDeprecation(canvas()->document(), UseCounter::Canva
sRenderingContext2DCompositeOperationDarker); | |
| 639 } | |
| 640 if (!parseCompositeAndBlendOperator(operationName, op, blendMode)) | |
| 641 return; | 633 return; |
| 642 SkXfermode::Mode xfermode = WebCoreCompositeToSkiaComposite(op, blendMode); | 634 SkXfermode::Mode xfermode = WebCoreCompositeToSkiaComposite(op, blendMode); |
| 643 if (state().globalComposite() == xfermode) | 635 if (state().globalComposite() == xfermode) |
| 644 return; | 636 return; |
| 645 modifiableState().setGlobalComposite(xfermode); | 637 modifiableState().setGlobalComposite(xfermode); |
| 646 } | 638 } |
| 647 | 639 |
| 648 String CanvasRenderingContext2D::filter() const | 640 String CanvasRenderingContext2D::filter() const |
| 649 { | 641 { |
| 650 return state().unparsedFilter(); | 642 return state().unparsedFilter(); |
| (...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2337 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) | 2329 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) |
| 2338 return; | 2330 return; |
| 2339 if (alpha < 0xFF) | 2331 if (alpha < 0xFF) |
| 2340 return; | 2332 return; |
| 2341 } | 2333 } |
| 2342 | 2334 |
| 2343 canvas()->buffer()->willOverwriteCanvas(); | 2335 canvas()->buffer()->willOverwriteCanvas(); |
| 2344 } | 2336 } |
| 2345 | 2337 |
| 2346 } // namespace blink | 2338 } // namespace blink |
| OLD | NEW |