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

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

Issue 1815513002: Remove unnecessary WebGLRenderingContextBase unregistration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment wording Created 4 years, 9 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 | no next file » | 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 forciblyEvictedContexts().set(context, generation++); 198 forciblyEvictedContexts().set(context, generation++);
199 } 199 }
200 200
201 void WebGLRenderingContextBase::removeFromEvictedList(WebGLRenderingContextBase* context) 201 void WebGLRenderingContextBase::removeFromEvictedList(WebGLRenderingContextBase* context)
202 { 202 {
203 forciblyEvictedContexts().remove(context); 203 forciblyEvictedContexts().remove(context);
204 } 204 }
205 205
206 void WebGLRenderingContextBase::willDestroyContext(WebGLRenderingContextBase* co ntext) 206 void WebGLRenderingContextBase::willDestroyContext(WebGLRenderingContextBase* co ntext)
207 { 207 {
208 #if ENABLE(OILPAN)
209 // These two sets keep weak references to their contexts;
210 // verify that the GC already removed the |context| entries.
211 ASSERT(!forciblyEvictedContexts().contains(context));
212 ASSERT(!activeContexts().contains(context));
213 #else
208 removeFromEvictedList(context); 214 removeFromEvictedList(context);
209 deactivateContext(context); 215 deactivateContext(context);
216 #endif
210 217
211 // Try to re-enable the oldest inactive contexts. 218 // Try to re-enable the oldest inactive contexts.
212 while (activeContexts().size() < maxGLActiveContexts && forciblyEvictedConte xts().size()) { 219 while (activeContexts().size() < maxGLActiveContexts && forciblyEvictedConte xts().size()) {
213 WebGLRenderingContextBase* evictedContext = oldestEvictedContext(); 220 WebGLRenderingContextBase* evictedContext = oldestEvictedContext();
214 if (!evictedContext->m_restoreAllowed) { 221 if (!evictedContext->m_restoreAllowed) {
215 forciblyEvictedContexts().remove(evictedContext); 222 forciblyEvictedContexts().remove(evictedContext);
216 continue; 223 continue;
217 } 224 }
218 225
219 IntSize desiredSize = DrawingBuffer::adjustSize(evictedContext->clampedC anvasSize(), IntSize(), evictedContext->m_maxTextureSize); 226 IntSize desiredSize = DrawingBuffer::adjustSize(evictedContext->clampedC anvasSize(), IntSize(), evictedContext->m_maxTextureSize);
(...skipping 6068 matching lines...) Expand 10 before | Expand all | Expand 10 after
6288 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); 6295 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1);
6289 } 6296 }
6290 6297
6291 void WebGLRenderingContextBase::restoreUnpackParameters() 6298 void WebGLRenderingContextBase::restoreUnpackParameters()
6292 { 6299 {
6293 if (m_unpackAlignment != 1) 6300 if (m_unpackAlignment != 1)
6294 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); 6301 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
6295 } 6302 }
6296 6303
6297 } // namespace blink 6304 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698