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

Side by Side Diff: Source/platform/graphics/gpu/Extensions3DUtil.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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "platform/graphics/gpu/Extensions3DUtil.h" 6 #include "platform/graphics/gpu/Extensions3DUtil.h"
7 7
8 #include "public/platform/WebGraphicsContext3D.h" 8 #include "public/platform/WebGraphicsContext3D.h"
9 #include "wtf/text/CString.h" 9 #include "wtf/text/CString.h"
10 #include "wtf/text/StringHash.h" 10 #include "wtf/text/StringHash.h"
(...skipping 24 matching lines...) Expand all
35 : m_context(context) 35 : m_context(context)
36 { 36 {
37 } 37 }
38 38
39 Extensions3DUtil::~Extensions3DUtil() 39 Extensions3DUtil::~Extensions3DUtil()
40 { 40 {
41 } 41 }
42 42
43 bool Extensions3DUtil::initializeExtensions() 43 bool Extensions3DUtil::initializeExtensions()
44 { 44 {
45 if (!m_context->makeContextCurrent()) {
46 // Most likely the GPU process exited and the attempt to reconnect to it failed.
47 // Need to try to restore the context again later.
48 return false;
49 }
50
51 if (m_context->isContextLost()) { 45 if (m_context->isContextLost()) {
52 // Need to try to restore the context again later. 46 // Need to try to restore the context again later.
53 return false; 47 return false;
54 } 48 }
55 49
56 String extensionsString = m_context->getString(GL_EXTENSIONS); 50 String extensionsString = m_context->getString(GL_EXTENSIONS);
57 splitStringHelper(extensionsString, m_enabledExtensions); 51 splitStringHelper(extensionsString, m_enabledExtensions);
58 52
59 String requestableExtensionsString = m_context->getRequestableExtensionsCHRO MIUM(); 53 String requestableExtensionsString = m_context->getRequestableExtensionsCHRO MIUM();
60 splitStringHelper(requestableExtensionsString, m_requestableExtensions); 54 splitStringHelper(requestableExtensionsString, m_requestableExtensions);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // FIXME: restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be lif ted when 86 // FIXME: restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be lif ted when
93 // WebGraphicsContext3D::copyTextureCHROMIUM(...) are fully functional. 87 // WebGraphicsContext3D::copyTextureCHROMIUM(...) are fully functional.
94 if ((destFormat == GL_RGB || destFormat == GL_RGBA) 88 if ((destFormat == GL_RGB || destFormat == GL_RGBA)
95 && destType == GL_UNSIGNED_BYTE 89 && destType == GL_UNSIGNED_BYTE
96 && !level) 90 && !level)
97 return true; 91 return true;
98 return false; 92 return false;
99 } 93 }
100 94
101 } // namespace blink 95 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/gpu/DrawingBuffer.cpp ('k') | Source/platform/graphics/test/MockWebGraphicsContext3D.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698