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

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: Created 4 years, 7 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) 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 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 ASSERT(drawingBuffer()); 1053 ASSERT(drawingBuffer());
1054 m_drawingBuffer->beginDestruction(); 1054 m_drawingBuffer->beginDestruction();
1055 m_drawingBuffer.clear(); 1055 m_drawingBuffer.clear();
1056 } 1056 }
1057 1057
1058 void WebGLRenderingContextBase::markContextChanged(ContentChangeType changeType) 1058 void WebGLRenderingContextBase::markContextChanged(ContentChangeType changeType)
1059 { 1059 {
1060 if (m_framebufferBinding || isContextLost()) 1060 if (m_framebufferBinding || isContextLost())
1061 return; 1061 return;
1062 1062
1063 drawingBuffer()->markContentsChanged(); 1063 if (!drawingBuffer()->markContentsChanged())
1064 return;
1064 1065
1065 LayoutBox* layoutBox = canvas()->layoutBox(); 1066 LayoutBox* layoutBox = canvas()->layoutBox();
1066 if (layoutBox && layoutBox->hasAcceleratedCompositing()) { 1067 if (layoutBox && layoutBox->hasAcceleratedCompositing()) {
1067 m_markedCanvasDirty = true; 1068 m_markedCanvasDirty = true;
1068 canvas()->clearCopiedImage(); 1069 canvas()->clearCopiedImage();
1069 layoutBox->contentChanged(changeType); 1070 layoutBox->contentChanged(changeType);
1070 } else { 1071 } else {
1071 if (!m_markedCanvasDirty) { 1072 if (!m_markedCanvasDirty) {
1072 m_markedCanvasDirty = true; 1073 m_markedCanvasDirty = true;
1073 canvas()->didDraw(FloatRect(FloatPoint(0, 0), FloatSize(clampedCanva sSize()))); 1074 canvas()->didDraw(FloatRect(FloatPoint(0, 0), FloatSize(clampedCanva sSize())));
(...skipping 5148 matching lines...) Expand 10 before | Expand all | Expand 10 after
6222 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); 6223 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1);
6223 } 6224 }
6224 6225
6225 void WebGLRenderingContextBase::restoreUnpackParameters() 6226 void WebGLRenderingContextBase::restoreUnpackParameters()
6226 { 6227 {
6227 if (m_unpackAlignment != 1) 6228 if (m_unpackAlignment != 1)
6228 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); 6229 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
6229 } 6230 }
6230 6231
6231 } // namespace blink 6232 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698