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

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

Issue 2561733002: Add WebGLContextObject::traceWrappers, and trace its context. (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLContextObject.h ('k') | 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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 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 12 matching lines...) Expand all
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "modules/webgl/WebGLContextObject.h" 26 #include "modules/webgl/WebGLContextObject.h"
27 27
28 #include "modules/webgl/WebGLRenderingContextBase.h" 28 #include "modules/webgl/WebGLRenderingContextBase.h"
29 29
30 namespace blink { 30 namespace blink {
31 31
32 WebGLContextObject::WebGLContextObject(WebGLRenderingContextBase* context) 32 WebGLContextObject::WebGLContextObject(WebGLRenderingContextBase* context)
33 : WebGLObject(context), m_context(context) {} 33 : WebGLObject(context), m_context(this, context) {}
34 34
35 bool WebGLContextObject::validate( 35 bool WebGLContextObject::validate(
36 const WebGLContextGroup*, 36 const WebGLContextGroup*,
37 const WebGLRenderingContextBase* context) const { 37 const WebGLRenderingContextBase* context) const {
38 // The contexts and context groups no longer maintain references to all 38 // The contexts and context groups no longer maintain references to all
39 // the objects they ever created, so there's no way to invalidate them 39 // the objects they ever created, so there's no way to invalidate them
40 // eagerly during context loss. The invalidation is discovered lazily. 40 // eagerly during context loss. The invalidation is discovered lazily.
41 return context == m_context && 41 return context == m_context &&
42 cachedNumberOfContextLosses() == context->numberOfContextLosses(); 42 cachedNumberOfContextLosses() == context->numberOfContextLosses();
43 } 43 }
44 44
45 uint32_t WebGLContextObject::currentNumberOfContextLosses() const { 45 uint32_t WebGLContextObject::currentNumberOfContextLosses() const {
46 return m_context->numberOfContextLosses(); 46 return m_context->numberOfContextLosses();
47 } 47 }
48 48
49 gpu::gles2::GLES2Interface* WebGLContextObject::getAGLInterface() const { 49 gpu::gles2::GLES2Interface* WebGLContextObject::getAGLInterface() const {
50 return m_context->contextGL(); 50 return m_context->contextGL();
51 } 51 }
52 52
53 DEFINE_TRACE(WebGLContextObject) { 53 DEFINE_TRACE(WebGLContextObject) {
54 visitor->trace(m_context); 54 visitor->trace(m_context);
55 WebGLObject::trace(visitor); 55 WebGLObject::trace(visitor);
56 } 56 }
57 57
58 DEFINE_TRACE_WRAPPERS(WebGLContextObject) {
59 visitor->traceWrappers(m_context);
60 WebGLObject::traceWrappers(visitor);
61 }
62
58 } // namespace blink 63 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLContextObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698