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

Unified Diff: webkit/gpu/webgraphicscontext3d_in_process_impl.cc

Issue 7633076: Allow GraphicsContext3D to be created with a NULL WebView for offscreen (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 | « webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/gpu/webgraphicscontext3d_in_process_impl.cc
===================================================================
--- webkit/gpu/webgraphicscontext3d_in_process_impl.cc (revision 96767)
+++ webkit/gpu/webgraphicscontext3d_in_process_impl.cc (working copy)
@@ -114,7 +114,8 @@
if (!render_directly_to_web_view) {
// Pick up the compositor's context to share resources with.
- WebGraphicsContext3D* view_context = webView->graphicsContext3D();
+ WebGraphicsContext3D* view_context = webView ?
+ webView->graphicsContext3D() : NULL;
if (view_context) {
WebGraphicsContext3DInProcessImpl* contextImpl =
static_cast<WebGraphicsContext3DInProcessImpl*>(view_context);
@@ -148,7 +149,7 @@
// a page unload event, iterate down any live WebGraphicsContext3D instances
// and force them to drop their contexts, sending a context lost event if
// necessary.
- webView->mainFrame()->collectGarbage();
+ if (webView) webView->mainFrame()->collectGarbage();
gl_surface_ = gfx::GLSurface::CreateOffscreenGLSurface(false,
gfx::Size(1, 1));
@@ -169,7 +170,7 @@
// a page unload event, iterate down any live WebGraphicsContext3D instances
// and force them to drop their contexts, sending a context lost event if
// necessary.
- webView->mainFrame()->collectGarbage();
+ if (webView) webView->mainFrame()->collectGarbage();
gl_context_ = gfx::GLContext::CreateGLContext(share_group,
gl_surface_.get());
@@ -1329,10 +1330,6 @@
WGC3Denum target, WGC3Dint level, WGC3Denum internalFormat,
WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border,
WGC3Denum format, WGC3Denum type, const void* pixels) {
- if (width && height && !pixels) {
- synthesizeGLError(GL_INVALID_VALUE);
- return;
- }
makeContextCurrent();
glTexImage2D(target, level, internalFormat,
width, height, border, format, type, pixels);
« no previous file with comments | « webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698