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

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: fix gpu bot failure Created 6 years, 3 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
« 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 5487 matching lines...) Expand 10 before | Expand all | Expand 10 after
5498 #else 5498 #else
5499 m_drawingBuffer->beginDestruction(); 5499 m_drawingBuffer->beginDestruction();
5500 m_drawingBuffer.clear(); 5500 m_drawingBuffer.clear();
5501 #endif 5501 #endif
5502 } 5502 }
5503 5503
5504 blink::WebGraphicsContext3D::Attributes attributes = m_requestedAttributes-> attributes(canvas()->document().topDocument().url().string(), settings, version( )); 5504 blink::WebGraphicsContext3D::Attributes attributes = m_requestedAttributes-> attributes(canvas()->document().topDocument().url().string(), settings, version( ));
5505 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr ent()->createOffscreenGraphicsContext3D(attributes, 0)); 5505 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr ent()->createOffscreenGraphicsContext3D(attributes, 0));
5506 RefPtr<DrawingBuffer> buffer; 5506 RefPtr<DrawingBuffer> buffer;
5507 // Even if a non-null WebGraphicsContext3D is created, until it's made curre nt, it isn't known whether the context is still lost. 5507 // Even if a non-null WebGraphicsContext3D is created, until it's made curre nt, it isn't known whether the context is still lost.
5508 if (context) { 5508 if (context && context->makeContextCurrent()) {
dshwang 2014/08/26 18:21:47 Currently, this code skipped the first makeContext
5509 // Construct a new drawing buffer with the new WebGraphicsContext3D. 5509 // Construct a new drawing buffer with the new WebGraphicsContext3D.
5510 buffer = createDrawingBuffer(context.release()); 5510 buffer = createDrawingBuffer(context.release());
5511 // If DrawingBuffer::create() fails to allocate a fbo, |drawingBuffer| i s set to null. 5511 // If DrawingBuffer::create() fails to allocate a fbo, |drawingBuffer| i s set to null.
5512 } 5512 }
5513 if (!buffer) { 5513 if (!buffer) {
5514 if (m_contextLostMode == RealLostContext) { 5514 if (m_contextLostMode == RealLostContext) {
5515 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts, FROM_HERE ); 5515 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts, FROM_HERE );
5516 } else { 5516 } else {
5517 // This likely shouldn't happen but is the best way to report it to the WebGL app. 5517 // This likely shouldn't happen but is the best way to report it to the WebGL app.
5518 synthesizeGLError(GL_INVALID_OPERATION, "", "error restoring context "); 5518 synthesizeGLError(GL_INVALID_OPERATION, "", "error restoring context ");
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
5758 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; 5758 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0;
5759 } 5759 }
5760 #else 5760 #else
5761 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 5761 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
5762 { 5762 {
5763 return m_drawingBuffer.get(); 5763 return m_drawingBuffer.get();
5764 } 5764 }
5765 #endif 5765 #endif
5766 5766
5767 } // namespace blink 5767 } // 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
This is Rietveld 408576698