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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.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) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 165 }
166 166
167 DrawingBuffer::~DrawingBuffer() 167 DrawingBuffer::~DrawingBuffer()
168 { 168 {
169 ASSERT(m_destructionInProgress); 169 ASSERT(m_destructionInProgress);
170 ASSERT(m_textureMailboxes.isEmpty()); 170 ASSERT(m_textureMailboxes.isEmpty());
171 m_layer.clear(); 171 m_layer.clear();
172 m_contextProvider.clear(); 172 m_contextProvider.clear();
173 } 173 }
174 174
175 void DrawingBuffer::markContentsChanged() 175 bool DrawingBuffer::markContentsChanged()
176 { 176 {
177 m_contentsChanged = true;
178 m_contentsChangeCommitted = false; 177 m_contentsChangeCommitted = false;
178 if (!m_contentsChanged) {
179 m_contentsChanged = true;
180 return true;
181 }
182 return false;
179 } 183 }
180 184
181 bool DrawingBuffer::bufferClearNeeded() const 185 bool DrawingBuffer::bufferClearNeeded() const
182 { 186 {
183 return m_bufferClearNeeded; 187 return m_bufferClearNeeded;
184 } 188 }
185 189
186 void DrawingBuffer::setBufferClearNeeded(bool flag) 190 void DrawingBuffer::setBufferClearNeeded(bool flag)
187 { 191 {
188 if (m_preserveDrawingBuffer == Discard) { 192 if (m_preserveDrawingBuffer == Discard) {
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 1007
1004 if (m_antiAliasingMode == MSAAImplicitResolve) 1008 if (m_antiAliasingMode == MSAAImplicitResolve)
1005 m_gl->FramebufferTexture2DMultisampleEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACH MENT0, target, m_colorBuffer.textureId, 0, m_sampleCount); 1009 m_gl->FramebufferTexture2DMultisampleEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACH MENT0, target, m_colorBuffer.textureId, 0, m_sampleCount);
1006 else 1010 else
1007 m_gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, target, m_colorBuffer.textureId, 0); 1011 m_gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, target, m_colorBuffer.textureId, 0);
1008 1012
1009 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); 1013 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding);
1010 } 1014 }
1011 1015
1012 } // namespace blink 1016 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698