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

Unified Diff: Source/core/html/canvas/WebGLRenderingContext.cpp

Issue 127493002: Removed most calls to GraphicsContext3D from DrawingBuffer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moved texImage2DSafe to DrawingBuffer, it's only caller. Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContext.h ('k') | Source/platform/graphics/GraphicsContext3D.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/WebGLRenderingContext.cpp
diff --git a/Source/core/html/canvas/WebGLRenderingContext.cpp b/Source/core/html/canvas/WebGLRenderingContext.cpp
index 447cbb56c1076a1e00f5f3523516a84088e46dd1..0fcb33ff7cc743961c626d01694152159c80eb5b 100644
--- a/Source/core/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/core/html/canvas/WebGLRenderingContext.cpp
@@ -126,7 +126,7 @@ size_t WebGLRenderingContext::oldestContextIndex()
size_t candidateID = 0;
for (size_t ii = 1; ii < activeContexts().size(); ++ii) {
WebGLRenderingContext* context = activeContexts()[ii];
- if (context->graphicsContext3D() && candidate->graphicsContext3D() && context->graphicsContext3D()->lastFlushID() < candidate->graphicsContext3D()->lastFlushID()) {
+ if (context->webGraphicsContext3D() && candidate->webGraphicsContext3D() && context->webGraphicsContext3D()->lastFlushID() < candidate->webGraphicsContext3D()->lastFlushID()) {
candidate = context;
candidateID = ii;
}
@@ -529,7 +529,7 @@ PassOwnPtr<WebGLRenderingContext> WebGLRenderingContext::create(HTMLCanvasElemen
}
if (contextSupport->supportsExtension("GL_EXT_debug_marker"))
- contextSupport->webContext()->pushGroupMarkerEXT("WebGLRenderingContext");
+ context->pushGroupMarkerEXT("WebGLRenderingContext");
OwnPtr<WebGLRenderingContext> renderingContext = adoptPtr(new WebGLRenderingContext(canvas, context.release(), contextSupport, attributes, requestedAttributes, preserveDrawingBuffer));
renderingContext->suspendIfNeeded();
@@ -577,7 +577,7 @@ WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement* passedCanvas, Pa
// Create the DrawingBuffer and initialize the platform layer.
DrawingBuffer::PreserveDrawingBuffer preserve = preserveDrawingBuffer ? DrawingBuffer::Preserve : DrawingBuffer::Discard;
- m_drawingBuffer = DrawingBuffer::create(m_contextSupport.get(), clampedCanvasSize(), preserve, contextEvictionManager.release());
+ m_drawingBuffer = DrawingBuffer::create(m_context.get(), clampedCanvasSize(), preserve, contextEvictionManager.release());
if (!m_drawingBuffer->isZeroSized()) {
m_drawingBuffer->bind();
@@ -803,7 +803,6 @@ void WebGLRenderingContext::markContextChanged()
if (m_framebufferBinding || isContextLost())
return;
- m_contextSupport->markContextChanged();
m_drawingBuffer->markContentsChanged();
m_layerCleared = false;
@@ -825,7 +824,7 @@ bool WebGLRenderingContext::clearIfComposited(GLbitfield mask)
if (isContextLost())
return false;
- if (!m_contextSupport->layerComposited() || m_layerCleared
+ if (!m_drawingBuffer->layerComposited() || m_layerCleared
|| m_preserveDrawingBuffer || (mask && m_framebufferBinding))
return false;
@@ -890,7 +889,7 @@ void WebGLRenderingContext::restoreStateAfterClear()
void WebGLRenderingContext::markLayerComposited()
{
if (!isContextLost())
- m_contextSupport->markLayerComposited();
+ m_drawingBuffer->markLayerComposited();
}
void WebGLRenderingContext::paintRenderingResultsToCanvas()
@@ -905,7 +904,7 @@ void WebGLRenderingContext::paintRenderingResultsToCanvas()
// Until the canvas is written to by the application, the clear that
// happened after it was composited should be ignored by the compositor.
- if (m_contextSupport->layerComposited() && !m_preserveDrawingBuffer) {
+ if (m_drawingBuffer->layerComposited() && !m_preserveDrawingBuffer) {
m_drawingBuffer->paintCompositedResultsToCanvas(canvas()->buffer());
canvas()->makePresentationCopy();
@@ -921,7 +920,7 @@ void WebGLRenderingContext::paintRenderingResultsToCanvas()
m_drawingBuffer->commit();
if (!(canvas()->buffer())->copyRenderingResultsFromDrawingBuffer(m_drawingBuffer.get()))
- m_contextSupport->paintRenderingResultsToCanvas(canvas()->buffer(), m_drawingBuffer.get());
+ m_drawingBuffer->paintRenderingResultsToCanvas(canvas()->buffer());
if (m_framebufferBinding)
m_context->bindFramebuffer(GL_FRAMEBUFFER, objectOrZero(m_framebufferBinding.get()));
@@ -937,7 +936,7 @@ PassRefPtr<ImageData> WebGLRenderingContext::paintRenderingResultsToImageData()
clearIfComposited();
m_drawingBuffer->commit();
int width, height;
- RefPtr<Uint8ClampedArray> imageDataPixels = m_contextSupport->paintRenderingResultsToImageData(m_drawingBuffer.get(), width, height);
+ RefPtr<Uint8ClampedArray> imageDataPixels = m_drawingBuffer->paintRenderingResultsToImageData(width, height);
if (!imageDataPixels)
return 0;
@@ -3031,7 +3030,7 @@ void WebGLRenderingContext::pixelStorei(GLenum pname, GLint param)
if (param == 1 || param == 2 || param == 4 || param == 8) {
if (pname == GL_PACK_ALIGNMENT) {
m_packAlignment = param;
- m_contextSupport->setPackAlignment(param);
+ m_drawingBuffer->setPackAlignment(param);
} else { // GL_UNPACK_ALIGNMENT:
m_unpackAlignment = param;
}
@@ -5434,7 +5433,7 @@ void WebGLRenderingContext::maybeRestoreContext(Timer<WebGLRenderingContext>*)
// Construct a new drawing buffer with the new GraphicsContext3D.
m_drawingBuffer->releaseResources();
DrawingBuffer::PreserveDrawingBuffer preserve = m_preserveDrawingBuffer ? DrawingBuffer::Preserve : DrawingBuffer::Discard;
- m_drawingBuffer = DrawingBuffer::create(contextSupport.get(), clampedCanvasSize(), preserve, contextEvictionManager.release());
+ m_drawingBuffer = DrawingBuffer::create(context.get(), clampedCanvasSize(), preserve, contextEvictionManager.release());
if (m_drawingBuffer->isZeroSized())
return;
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContext.h ('k') | Source/platform/graphics/GraphicsContext3D.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698