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

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

Issue 1947763002: Early terminate WebGL markContextChanged calls when appropriate. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and minor logic tweak to fix tests Created 4 years, 6 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
« 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 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 ASSERT(drawingBuffer()); 1163 ASSERT(drawingBuffer());
1164 m_drawingBuffer->beginDestruction(); 1164 m_drawingBuffer->beginDestruction();
1165 m_drawingBuffer.clear(); 1165 m_drawingBuffer.clear();
1166 } 1166 }
1167 1167
1168 void WebGLRenderingContextBase::markContextChanged(ContentChangeType changeType) 1168 void WebGLRenderingContextBase::markContextChanged(ContentChangeType changeType)
1169 { 1169 {
1170 if (m_framebufferBinding || isContextLost()) 1170 if (m_framebufferBinding || isContextLost())
1171 return; 1171 return;
1172 1172
1173 drawingBuffer()->markContentsChanged(); 1173 if (m_markedCanvasDirty && !drawingBuffer()->markContentsChanged())
1174 return;
1174 1175
1175 if (!canvas()) 1176 if (!canvas())
1176 return; 1177 return;
1177 1178
1178 LayoutBox* layoutBox = canvas()->layoutBox(); 1179 LayoutBox* layoutBox = canvas()->layoutBox();
1179 if (layoutBox && layoutBox->hasAcceleratedCompositing()) { 1180 if (layoutBox && layoutBox->hasAcceleratedCompositing()) {
1180 m_markedCanvasDirty = true; 1181 m_markedCanvasDirty = true;
1181 canvas()->clearCopiedImage(); 1182 canvas()->clearCopiedImage();
1182 layoutBox->contentChanged(changeType); 1183 layoutBox->contentChanged(changeType);
1183 } else { 1184 } else {
(...skipping 5240 matching lines...) Expand 10 before | Expand all | Expand 10 after
6424 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); 6425 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1);
6425 } 6426 }
6426 6427
6427 void WebGLRenderingContextBase::restoreUnpackParameters() 6428 void WebGLRenderingContextBase::restoreUnpackParameters()
6428 { 6429 {
6429 if (m_unpackAlignment != 1) 6430 if (m_unpackAlignment != 1)
6430 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); 6431 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
6431 } 6432 }
6432 6433
6433 } // namespace blink 6434 } // 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