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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2510583004: Early terminate WebGL markContextChanged calls when appropriate (Closed)
Patch Set: even better Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 ASSERT(drawingBuffer()); 1327 ASSERT(drawingBuffer());
1328 m_drawingBuffer->beginDestruction(); 1328 m_drawingBuffer->beginDestruction();
1329 m_drawingBuffer.clear(); 1329 m_drawingBuffer.clear();
1330 } 1330 }
1331 1331
1332 void WebGLRenderingContextBase::markContextChanged( 1332 void WebGLRenderingContextBase::markContextChanged(
1333 ContentChangeType changeType) { 1333 ContentChangeType changeType) {
1334 if (m_framebufferBinding || isContextLost()) 1334 if (m_framebufferBinding || isContextLost())
1335 return; 1335 return;
1336 1336
1337 drawingBuffer()->markContentsChanged(); 1337 if (!drawingBuffer()->markContentsChanged() && m_markedCanvasDirty) {
Ken Russell (switch to Gerrit) 2016/11/29 04:31:16 We should really revisit and clean up the maintena
1338 return;
1339 }
1338 1340
1339 if (!canvas()) 1341 if (!canvas())
1340 return; 1342 return;
1341 1343
1342 LayoutBox* layoutBox = canvas()->layoutBox(); 1344 LayoutBox* layoutBox = canvas()->layoutBox();
1343 if (layoutBox && layoutBox->hasAcceleratedCompositing()) { 1345 if (layoutBox && layoutBox->hasAcceleratedCompositing()) {
1344 m_markedCanvasDirty = true; 1346 m_markedCanvasDirty = true;
1345 canvas()->clearCopiedImage(); 1347 canvas()->clearCopiedImage();
1346 layoutBox->contentChanged(changeType); 1348 layoutBox->contentChanged(changeType);
1347 } else { 1349 } else {
(...skipping 6421 matching lines...) Expand 10 before | Expand all | Expand 10 after
7769 7771
7770 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( 7772 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(
7771 HTMLCanvasElementOrOffscreenCanvas& result) const { 7773 HTMLCanvasElementOrOffscreenCanvas& result) const {
7772 if (canvas()) 7774 if (canvas())
7773 result.setHTMLCanvasElement(canvas()); 7775 result.setHTMLCanvasElement(canvas());
7774 else 7776 else
7775 result.setOffscreenCanvas(getOffscreenCanvas()); 7777 result.setOffscreenCanvas(getOffscreenCanvas());
7776 } 7778 }
7777 7779
7778 } // namespace blink 7780 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698