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

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

Issue 1153233005: Mark WebGLRenderingContext as having lost context upon init failure. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | no next file » | 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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 { 638 {
639 ASSERT(context); 639 ASSERT(context);
640 640
641 m_contextGroup = WebGLContextGroup::create(); 641 m_contextGroup = WebGLContextGroup::create();
642 m_contextGroup->addContext(this); 642 m_contextGroup->addContext(this);
643 643
644 m_maxViewportDims[0] = m_maxViewportDims[1] = 0; 644 m_maxViewportDims[0] = m_maxViewportDims[1] = 0;
645 context->getIntegerv(GL_MAX_VIEWPORT_DIMS, m_maxViewportDims); 645 context->getIntegerv(GL_MAX_VIEWPORT_DIMS, m_maxViewportDims);
646 646
647 RefPtr<DrawingBuffer> buffer = createDrawingBuffer(context); 647 RefPtr<DrawingBuffer> buffer = createDrawingBuffer(context);
648 if (!buffer) 648 if (!buffer) {
649 m_contextLostMode = SyntheticLostContext;
649 return; 650 return;
651 }
650 652
651 #if ENABLE(OILPAN) 653 #if ENABLE(OILPAN)
652 m_sharedWebGraphicsContext3D = WebGLSharedWebGraphicsContext3D::create(buffe r.release()); 654 m_sharedWebGraphicsContext3D = WebGLSharedWebGraphicsContext3D::create(buffe r.release());
653 #else 655 #else
654 m_drawingBuffer = buffer.release(); 656 m_drawingBuffer = buffer.release();
655 #endif 657 #endif
656 658
657 drawingBuffer()->bind(); 659 drawingBuffer()->bind();
658 setupFlags(); 660 setupFlags();
659 } 661 }
(...skipping 5580 matching lines...) Expand 10 before | Expand all | Expand 10 after
6240 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; 6242 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0;
6241 } 6243 }
6242 #else 6244 #else
6243 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 6245 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
6244 { 6246 {
6245 return m_drawingBuffer.get(); 6247 return m_drawingBuffer.get();
6246 } 6248 }
6247 #endif 6249 #endif
6248 6250
6249 } // namespace blink 6251 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698