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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLContextObject.cpp

Issue 2547813002: Remove WebGLObject maps from WebGLRenderingContextBase and WebGLContextGroup. (Closed)
Patch Set: Fixed WebGLContextObject::validate. Made WebGLExtension non-finalized. Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webgl/WebGLContextObject.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLContextObject.cpp b/third_party/WebKit/Source/modules/webgl/WebGLContextObject.cpp
index b42f12265843bac74136fd6d539cb72b2a9647cb..0965b282acdc64753507e0644b15700d7d615630 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLContextObject.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLContextObject.cpp
@@ -32,15 +32,18 @@ namespace blink {
WebGLContextObject::WebGLContextObject(WebGLRenderingContextBase* context)
: WebGLObject(context), m_context(context) {}
-WebGLContextObject::~WebGLContextObject() {}
-
-void WebGLContextObject::detachContext() {
- detach();
- if (m_context) {
- deleteObject(m_context->contextGL());
- m_context->removeContextObject(this);
- m_context = nullptr;
- }
+bool WebGLContextObject::validate(
+ const WebGLContextGroup*,
+ const WebGLRenderingContextBase* context) const {
+ // The contexts and context groups no longer maintain references to all
+ // the objects they ever created, so there's no way to invalidate them
+ // eagerly during context loss. The invalidation is discovered lazily.
+ return context == m_context &&
+ cachedNumberOfContextLosses() == context->numberOfContextLosses();
+}
+
+uint32_t WebGLContextObject::currentNumberOfContextLosses() const {
+ return m_context->numberOfContextLosses();
}
gpu::gles2::GLES2Interface* WebGLContextObject::getAGLInterface() const {

Powered by Google App Engine
This is Rietveld 408576698