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 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 bitmapSourceSize().height(), | 1336 bitmapSourceSize().height(), |
1337 exceptionState)) | 1337 exceptionState)) |
1338 return ScriptPromise(); | 1338 return ScriptPromise(); |
1339 if (!ImageBitmap::isResizeOptionValid(options, exceptionState)) | 1339 if (!ImageBitmap::isResizeOptionValid(options, exceptionState)) |
1340 return ScriptPromise(); | 1340 return ScriptPromise(); |
1341 return ImageBitmapSource::fulfillImageBitmap( | 1341 return ImageBitmapSource::fulfillImageBitmap( |
1342 scriptState, | 1342 scriptState, |
1343 isPaintable() ? ImageBitmap::create(this, cropRect, options) : nullptr); | 1343 isPaintable() ? ImageBitmap::create(this, cropRect, options) : nullptr); |
1344 } | 1344 } |
1345 | 1345 |
| 1346 void HTMLCanvasElement::setPlaceholderFrame( |
| 1347 RefPtr<StaticBitmapImage> image, |
| 1348 WeakPtr<OffscreenCanvasFrameDispatcher> dispatcher, |
| 1349 RefPtr<WebTaskRunner> taskRunner, |
| 1350 unsigned resourceId) { |
| 1351 OffscreenCanvasPlaceholder::setPlaceholderFrame( |
| 1352 std::move(image), std::move(dispatcher), std::move(taskRunner), |
| 1353 resourceId); |
| 1354 notifyListenersCanvasChanged(); |
| 1355 } |
| 1356 |
1346 bool HTMLCanvasElement::isOpaque() const { | 1357 bool HTMLCanvasElement::isOpaque() const { |
1347 return m_context && !m_context->creationAttributes().alpha(); | 1358 return m_context && !m_context->creationAttributes().alpha(); |
1348 } | 1359 } |
1349 | 1360 |
1350 bool HTMLCanvasElement::isSupportedInteractiveCanvasFallback( | 1361 bool HTMLCanvasElement::isSupportedInteractiveCanvasFallback( |
1351 const Element& element) { | 1362 const Element& element) { |
1352 if (!element.isDescendantOf(this)) | 1363 if (!element.isDescendantOf(this)) |
1353 return false; | 1364 return false; |
1354 | 1365 |
1355 // An element is a supported interactive canvas fallback element if it is one | 1366 // An element is a supported interactive canvas fallback element if it is one |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1441 // Creates a placeholder layer first before Surface is created. | 1452 // Creates a placeholder layer first before Surface is created. |
1442 m_surfaceLayerBridge->createSolidColorLayer(); | 1453 m_surfaceLayerBridge->createSolidColorLayer(); |
1443 } | 1454 } |
1444 } | 1455 } |
1445 | 1456 |
1446 void HTMLCanvasElement::OnWebLayerReplaced() { | 1457 void HTMLCanvasElement::OnWebLayerReplaced() { |
1447 setNeedsCompositingUpdate(); | 1458 setNeedsCompositingUpdate(); |
1448 } | 1459 } |
1449 | 1460 |
1450 } // namespace blink | 1461 } // namespace blink |
OLD | NEW |