| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
| 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. 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 23 matching lines...) Expand all Loading... |
| 34 #include "bindings/core/v8/ExceptionState.h" | 34 #include "bindings/core/v8/ExceptionState.h" |
| 35 #include "bindings/core/v8/ScriptController.h" | 35 #include "bindings/core/v8/ScriptController.h" |
| 36 #include "core/HTMLNames.h" | 36 #include "core/HTMLNames.h" |
| 37 #include "core/InputTypeNames.h" | 37 #include "core/InputTypeNames.h" |
| 38 #include "core/dom/Document.h" | 38 #include "core/dom/Document.h" |
| 39 #include "core/dom/Element.h" | 39 #include "core/dom/Element.h" |
| 40 #include "core/dom/ElementTraversal.h" | 40 #include "core/dom/ElementTraversal.h" |
| 41 #include "core/dom/ExceptionCode.h" | 41 #include "core/dom/ExceptionCode.h" |
| 42 #include "core/dom/TaskRunnerHelper.h" | 42 #include "core/dom/TaskRunnerHelper.h" |
| 43 #include "core/fileapi/File.h" | 43 #include "core/fileapi/File.h" |
| 44 #include "core/frame/FrameHost.h" | |
| 45 #include "core/frame/ImageBitmap.h" | 44 #include "core/frame/ImageBitmap.h" |
| 46 #include "core/frame/LocalFrame.h" | 45 #include "core/frame/LocalFrame.h" |
| 47 #include "core/frame/Settings.h" | 46 #include "core/frame/Settings.h" |
| 48 #include "core/frame/UseCounter.h" | 47 #include "core/frame/UseCounter.h" |
| 49 #include "core/html/HTMLImageElement.h" | 48 #include "core/html/HTMLImageElement.h" |
| 50 #include "core/html/HTMLInputElement.h" | 49 #include "core/html/HTMLInputElement.h" |
| 51 #include "core/html/HTMLSelectElement.h" | 50 #include "core/html/HTMLSelectElement.h" |
| 52 #include "core/html/ImageData.h" | 51 #include "core/html/ImageData.h" |
| 53 #include "core/html/canvas/CanvasAsyncBlobCreator.h" | 52 #include "core/html/canvas/CanvasAsyncBlobCreator.h" |
| 54 #include "core/html/canvas/CanvasContextCreationAttributes.h" | 53 #include "core/html/canvas/CanvasContextCreationAttributes.h" |
| (...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1441 } | 1440 } |
| 1442 | 1441 |
| 1443 void HTMLCanvasElement::createLayer() { | 1442 void HTMLCanvasElement::createLayer() { |
| 1444 DCHECK(!m_surfaceLayerBridge); | 1443 DCHECK(!m_surfaceLayerBridge); |
| 1445 LocalFrame* frame = document().frame(); | 1444 LocalFrame* frame = document().frame(); |
| 1446 WebLayerTreeView* layerTreeView = nullptr; | 1445 WebLayerTreeView* layerTreeView = nullptr; |
| 1447 // TODO(xlai): Ensure OffscreenCanvas commit() is still functional when a | 1446 // TODO(xlai): Ensure OffscreenCanvas commit() is still functional when a |
| 1448 // frame-less HTML canvas's document is reparenting under another frame. | 1447 // frame-less HTML canvas's document is reparenting under another frame. |
| 1449 // See crbug.com/683172. | 1448 // See crbug.com/683172. |
| 1450 if (frame) { | 1449 if (frame) { |
| 1451 layerTreeView = frame->host()->chromeClient().getWebLayerTreeView(frame); | 1450 layerTreeView = frame->page()->chromeClient().getWebLayerTreeView(frame); |
| 1452 m_surfaceLayerBridge = | 1451 m_surfaceLayerBridge = |
| 1453 WTF::wrapUnique(new CanvasSurfaceLayerBridge(this, layerTreeView)); | 1452 WTF::wrapUnique(new CanvasSurfaceLayerBridge(this, layerTreeView)); |
| 1454 // Creates a placeholder layer first before Surface is created. | 1453 // Creates a placeholder layer first before Surface is created. |
| 1455 m_surfaceLayerBridge->createSolidColorLayer(); | 1454 m_surfaceLayerBridge->createSolidColorLayer(); |
| 1456 } | 1455 } |
| 1457 } | 1456 } |
| 1458 | 1457 |
| 1459 void HTMLCanvasElement::OnWebLayerReplaced() { | 1458 void HTMLCanvasElement::OnWebLayerReplaced() { |
| 1460 setNeedsCompositingUpdate(); | 1459 setNeedsCompositingUpdate(); |
| 1461 } | 1460 } |
| 1462 | 1461 |
| 1463 } // namespace blink | 1462 } // namespace blink |
| OLD | NEW |