Chromium Code Reviews

Side by Side Diff: Source/core/html/canvas/WebGLRenderingContextBase.cpp

Issue 481433002: gpu: Remove WebGraphicsContext3D::makeContextCurrent() in Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase to ToT Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « Source/core/html/HTMLVideoElement.cpp ('k') | Source/platform/graphics/Canvas2DLayerBridge.cpp » ('j') | 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 5493 matching lines...)
5504 #else 5504 #else
5505 m_drawingBuffer->beginDestruction(); 5505 m_drawingBuffer->beginDestruction();
5506 m_drawingBuffer.clear(); 5506 m_drawingBuffer.clear();
5507 #endif 5507 #endif
5508 } 5508 }
5509 5509
5510 blink::WebGraphicsContext3D::Attributes attributes = m_requestedAttributes-> attributes(canvas()->document().topDocument().url().string(), settings, version( )); 5510 blink::WebGraphicsContext3D::Attributes attributes = m_requestedAttributes-> attributes(canvas()->document().topDocument().url().string(), settings, version( ));
5511 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr ent()->createOffscreenGraphicsContext3D(attributes, 0)); 5511 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr ent()->createOffscreenGraphicsContext3D(attributes, 0));
5512 RefPtr<DrawingBuffer> buffer; 5512 RefPtr<DrawingBuffer> buffer;
5513 // Even if a non-null WebGraphicsContext3D is created, until it's made curre nt, it isn't known whether the context is still lost. 5513 // Even if a non-null WebGraphicsContext3D is created, until it's made curre nt, it isn't known whether the context is still lost.
5514 if (context) { 5514 if (context && context->makeContextCurrent()) {
5515 // Construct a new drawing buffer with the new WebGraphicsContext3D. 5515 // Construct a new drawing buffer with the new WebGraphicsContext3D.
5516 buffer = createDrawingBuffer(context.release()); 5516 buffer = createDrawingBuffer(context.release());
5517 // If DrawingBuffer::create() fails to allocate a fbo, |drawingBuffer| i s set to null. 5517 // If DrawingBuffer::create() fails to allocate a fbo, |drawingBuffer| i s set to null.
5518 } 5518 }
5519 if (!buffer) { 5519 if (!buffer) {
5520 if (m_contextLostMode == RealLostContext) { 5520 if (m_contextLostMode == RealLostContext) {
5521 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts, FROM_HERE ); 5521 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts, FROM_HERE );
5522 } else { 5522 } else {
5523 // This likely shouldn't happen but is the best way to report it to the WebGL app. 5523 // This likely shouldn't happen but is the best way to report it to the WebGL app.
5524 synthesizeGLError(GL_INVALID_OPERATION, "", "error restoring context "); 5524 synthesizeGLError(GL_INVALID_OPERATION, "", "error restoring context ");
(...skipping 239 matching lines...)
5764 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; 5764 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0;
5765 } 5765 }
5766 #else 5766 #else
5767 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 5767 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
5768 { 5768 {
5769 return m_drawingBuffer.get(); 5769 return m_drawingBuffer.get();
5770 } 5770 }
5771 #endif 5771 #endif
5772 5772
5773 } // namespace blink 5773 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLVideoElement.cpp ('k') | Source/platform/graphics/Canvas2DLayerBridge.cpp » ('j') | no next file with comments »

Powered by Google App Engine