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 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1390 return m_context->getControlAndIdIfHitRegionExists(location); | 1390 return m_context->getControlAndIdIfHitRegionExists(location); |
1391 return HitTestCanvasResult::create(String(), nullptr); | 1391 return HitTestCanvasResult::create(String(), nullptr); |
1392 } | 1392 } |
1393 | 1393 |
1394 String HTMLCanvasElement::getIdFromControl(const Element* element) { | 1394 String HTMLCanvasElement::getIdFromControl(const Element* element) { |
1395 if (m_context) | 1395 if (m_context) |
1396 return m_context->getIdFromControl(element); | 1396 return m_context->getIdFromControl(element); |
1397 return String(); | 1397 return String(); |
1398 } | 1398 } |
1399 | 1399 |
1400 bool HTMLCanvasElement::createSurfaceLayer() { | 1400 void HTMLCanvasElement::createLayer() { |
1401 DCHECK(!m_surfaceLayerBridge); | 1401 DCHECK(!m_surfaceLayerBridge); |
1402 mojom::blink::OffscreenCanvasSurfacePtr service; | 1402 mojom::blink::OffscreenCanvasSurfacePtr service; |
1403 Platform::current()->interfaceProvider()->getInterface( | 1403 Platform::current()->interfaceProvider()->getInterface( |
1404 mojo::GetProxy(&service)); | 1404 mojo::GetProxy(&service)); |
1405 m_surfaceLayerBridge = | 1405 m_surfaceLayerBridge = |
1406 WTF::wrapUnique(new CanvasSurfaceLayerBridge(std::move(service))); | 1406 WTF::wrapUnique(new CanvasSurfaceLayerBridge(std::move(service), this)); |
1407 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), | 1407 // Creates a placeholder layer first before Surface is created. |
1408 this->height()); | 1408 m_surfaceLayerBridge->createSolidColorLayer(); |
| 1409 } |
| 1410 |
| 1411 void HTMLCanvasElement::OnWebLayerReplaced() { |
| 1412 setNeedsCompositingUpdate(); |
1409 } | 1413 } |
1410 | 1414 |
1411 } // namespace blink | 1415 } // namespace blink |
OLD | NEW |