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

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

Issue 2392313004: [wrapper-tracing] Add tracing to WebGLRenderingContextBase and friends (Closed)
Patch Set: Add WebGL2RenderingContextBase Created 4 years, 2 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 7443 matching lines...) Expand 10 before | Expand all | Expand 10 after
7454 visitor->trace(m_defaultVertexArrayObject); 7454 visitor->trace(m_defaultVertexArrayObject);
7455 visitor->trace(m_boundVertexArrayObject); 7455 visitor->trace(m_boundVertexArrayObject);
7456 visitor->trace(m_currentProgram); 7456 visitor->trace(m_currentProgram);
7457 visitor->trace(m_framebufferBinding); 7457 visitor->trace(m_framebufferBinding);
7458 visitor->trace(m_renderbufferBinding); 7458 visitor->trace(m_renderbufferBinding);
7459 visitor->trace(m_textureUnits); 7459 visitor->trace(m_textureUnits);
7460 visitor->trace(m_extensions); 7460 visitor->trace(m_extensions);
7461 CanvasRenderingContext::trace(visitor); 7461 CanvasRenderingContext::trace(visitor);
7462 } 7462 }
7463 7463
7464 DEFINE_TRACE_WRAPPERS(WebGLRenderingContextBase) {
7465 if (isContextLost()) {
7466 return;
7467 }
7468 visitor->traceWrappers(m_boundArrayBuffer);
7469 visitor->traceWrappers(m_renderbufferBinding);
7470 visitor->traceWrappers(m_framebufferBinding);
7471 visitor->traceWrappers(m_currentProgram);
7472 visitor->traceWrappers(m_boundVertexArrayObject);
7473 for (auto& unit : m_textureUnits) {
7474 visitor->traceWrappers(unit.m_texture2DBinding);
7475 visitor->traceWrappers(unit.m_textureCubeMapBinding);
7476 visitor->traceWrappers(unit.m_texture3DBinding);
7477 visitor->traceWrappers(unit.m_texture2DArrayBinding);
7478 }
7479 for (ExtensionTracker* tracker : m_extensions) {
7480 WebGLExtension* extension = tracker->getExtensionObjectIfAlreadyEnabled();
7481 visitor->traceWrappers(extension);
7482 }
7483 CanvasRenderingContext::traceWrappers(visitor);
7484 }
7485
7464 int WebGLRenderingContextBase::externallyAllocatedBytesPerPixel() { 7486 int WebGLRenderingContextBase::externallyAllocatedBytesPerPixel() {
7465 if (isContextLost()) 7487 if (isContextLost())
7466 return 0; 7488 return 0;
7467 7489
7468 int bytesPerPixel = 4; 7490 int bytesPerPixel = 4;
7469 int totalBytesPerPixel = 7491 int totalBytesPerPixel =
7470 bytesPerPixel * 2; // WebGL's front and back color buffers. 7492 bytesPerPixel * 2; // WebGL's front and back color buffers.
7471 int samples = drawingBuffer() ? drawingBuffer()->sampleCount() : 0; 7493 int samples = drawingBuffer() ? drawingBuffer()->sampleCount() : 0;
7472 Nullable<WebGLContextAttributes> attribs; 7494 Nullable<WebGLContextAttributes> attribs;
7473 getContextAttributes(attribs); 7495 getContextAttributes(attribs);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
7506 7528
7507 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( 7529 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(
7508 HTMLCanvasElementOrOffscreenCanvas& result) const { 7530 HTMLCanvasElementOrOffscreenCanvas& result) const {
7509 if (canvas()) 7531 if (canvas())
7510 result.setHTMLCanvasElement(canvas()); 7532 result.setHTMLCanvasElement(canvas());
7511 else 7533 else
7512 result.setOffscreenCanvas(getOffscreenCanvas()); 7534 result.setOffscreenCanvas(getOffscreenCanvas());
7513 } 7535 }
7514 7536
7515 } // namespace blink 7537 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698