Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 2632593003: Notify listeners on OffScreenCanvas changes (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 bitmapSourceSize().height(), 1330 bitmapSourceSize().height(),
1331 exceptionState)) 1331 exceptionState))
1332 return ScriptPromise(); 1332 return ScriptPromise();
1333 if (!ImageBitmap::isResizeOptionValid(options, exceptionState)) 1333 if (!ImageBitmap::isResizeOptionValid(options, exceptionState))
1334 return ScriptPromise(); 1334 return ScriptPromise();
1335 return ImageBitmapSource::fulfillImageBitmap( 1335 return ImageBitmapSource::fulfillImageBitmap(
1336 scriptState, 1336 scriptState,
1337 isPaintable() ? ImageBitmap::create(this, cropRect, options) : nullptr); 1337 isPaintable() ? ImageBitmap::create(this, cropRect, options) : nullptr);
1338 } 1338 }
1339 1339
1340 void HTMLCanvasElement::setPlaceholderFrame(
1341 RefPtr<StaticBitmapImage> image,
1342 WeakPtr<OffscreenCanvasFrameDispatcher> dispatcher,
1343 RefPtr<WebTaskRunner> taskRunner,
1344 unsigned resourceId) {
1345 OffscreenCanvasPlaceholder::setPlaceholderFrame(
1346 std::move(image), std::move(dispatcher), std::move(taskRunner),
1347 resourceId);
1348 notifyListenersCanvasChanged();
1349 }
1350
1340 bool HTMLCanvasElement::isOpaque() const { 1351 bool HTMLCanvasElement::isOpaque() const {
1341 return m_context && !m_context->creationAttributes().alpha(); 1352 return m_context && !m_context->creationAttributes().alpha();
1342 } 1353 }
1343 1354
1344 bool HTMLCanvasElement::isSupportedInteractiveCanvasFallback( 1355 bool HTMLCanvasElement::isSupportedInteractiveCanvasFallback(
1345 const Element& element) { 1356 const Element& element) {
1346 if (!element.isDescendantOf(this)) 1357 if (!element.isDescendantOf(this))
1347 return false; 1358 return false;
1348 1359
1349 // An element is a supported interactive canvas fallback element if it is one 1360 // An element is a supported interactive canvas fallback element if it is one
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 m_surfaceLayerBridge = WTF::wrapUnique(new CanvasSurfaceLayerBridge(this)); 1437 m_surfaceLayerBridge = WTF::wrapUnique(new CanvasSurfaceLayerBridge(this));
1427 // Creates a placeholder layer first before Surface is created. 1438 // Creates a placeholder layer first before Surface is created.
1428 m_surfaceLayerBridge->createSolidColorLayer(); 1439 m_surfaceLayerBridge->createSolidColorLayer();
1429 } 1440 }
1430 1441
1431 void HTMLCanvasElement::OnWebLayerReplaced() { 1442 void HTMLCanvasElement::OnWebLayerReplaced() {
1432 setNeedsCompositingUpdate(); 1443 setNeedsCompositingUpdate();
1433 } 1444 }
1434 1445
1435 } // namespace blink 1446 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698