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

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

Issue 2808493002: [blink] Request compositing update when canvas hibernates/wakes up. (Closed)
Patch Set: add test Created 3 years, 8 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 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 return; 1209 return;
1210 1210
1211 bool hidden = !page()->isPageVisible(); 1211 bool hidden = !page()->isPageVisible();
1212 m_context->setIsHidden(hidden); 1212 m_context->setIsHidden(hidden);
1213 if (hidden) { 1213 if (hidden) {
1214 clearCopiedImage(); 1214 clearCopiedImage();
1215 if (is3D()) { 1215 if (is3D()) {
1216 discardImageBuffer(); 1216 discardImageBuffer();
1217 } 1217 }
1218 } 1218 }
1219 // If visibility changes, shouldBeDirectComposited() may change.
1220 setNeedsCompositingUpdate();
chrishtr 2017/04/07 17:12:32 Which of the conditions below depend on page visib
Eric Seckler 2017/04/07 17:27:11 CanvasRenderingContext2D::isComposited() -> isAcce
1219 } 1221 }
1220 1222
1221 void HTMLCanvasElement::contextDestroyed(ExecutionContext*) { 1223 void HTMLCanvasElement::contextDestroyed(ExecutionContext*) {
1222 if (m_context) 1224 if (m_context)
1223 m_context->stop(); 1225 m_context->stop();
1224 } 1226 }
1225 1227
1226 void HTMLCanvasElement::styleDidChange(const ComputedStyle* oldStyle, 1228 void HTMLCanvasElement::styleDidChange(const ComputedStyle* oldStyle,
1227 const ComputedStyle& newStyle) { 1229 const ComputedStyle& newStyle) {
1228 if (m_context) 1230 if (m_context)
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 // Creates a placeholder layer first before Surface is created. 1475 // Creates a placeholder layer first before Surface is created.
1474 m_surfaceLayerBridge->createSolidColorLayer(); 1476 m_surfaceLayerBridge->createSolidColorLayer();
1475 } 1477 }
1476 } 1478 }
1477 1479
1478 void HTMLCanvasElement::OnWebLayerReplaced() { 1480 void HTMLCanvasElement::OnWebLayerReplaced() {
1479 setNeedsCompositingUpdate(); 1481 setNeedsCompositingUpdate();
1480 } 1482 }
1481 1483
1482 } // namespace blink 1484 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/BUILD.gn ('k') | third_party/WebKit/Source/core/html/HTMLCanvasElementTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698