OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |