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