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

Unified Diff: sky/engine/platform/graphics/gpu/Extensions3DUtil.cpp

Issue 1229113003: Remove some unneeded DEPS from //sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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
Index: sky/engine/platform/graphics/gpu/Extensions3DUtil.cpp
diff --git a/sky/engine/platform/graphics/gpu/Extensions3DUtil.cpp b/sky/engine/platform/graphics/gpu/Extensions3DUtil.cpp
deleted file mode 100644
index bcc65027928ea1dbb5f8653bac51c39735a93fd5..0000000000000000000000000000000000000000
--- a/sky/engine/platform/graphics/gpu/Extensions3DUtil.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sky/engine/platform/graphics/gpu/Extensions3DUtil.h"
-
-#include "sky/engine/public/platform/WebGraphicsContext3D.h"
-#include "sky/engine/wtf/PassOwnPtr.h"
-#include "sky/engine/wtf/text/CString.h"
-#include "sky/engine/wtf/text/StringHash.h"
-
-namespace blink {
-
-namespace {
-
-void splitStringHelper(const String& str, HashSet<String>& set)
-{
- Vector<String> substrings;
- str.split(' ', substrings);
- for (size_t i = 0; i < substrings.size(); ++i)
- set.add(substrings[i]);
-}
-
-} // anonymous namespace
-
-PassOwnPtr<Extensions3DUtil> Extensions3DUtil::create(WebGraphicsContext3D* context)
-{
- OwnPtr<Extensions3DUtil> out = adoptPtr(new Extensions3DUtil(context));
- if (!out->initializeExtensions())
- return nullptr;
- return out.release();
-}
-
-Extensions3DUtil::Extensions3DUtil(WebGraphicsContext3D* context)
- : m_context(context)
-{
-}
-
-Extensions3DUtil::~Extensions3DUtil()
-{
-}
-
-bool Extensions3DUtil::initializeExtensions()
-{
- if (m_context->isContextLost()) {
- // Need to try to restore the context again later.
- return false;
- }
-
- String extensionsString = m_context->getString(GL_EXTENSIONS);
- splitStringHelper(extensionsString, m_enabledExtensions);
-
- String requestableExtensionsString = m_context->getRequestableExtensionsCHROMIUM();
- splitStringHelper(requestableExtensionsString, m_requestableExtensions);
-
- return true;
-}
-
-
-bool Extensions3DUtil::supportsExtension(const String& name)
-{
- return m_enabledExtensions.contains(name) || m_requestableExtensions.contains(name);
-}
-
-bool Extensions3DUtil::ensureExtensionEnabled(const String& name)
-{
- if (m_enabledExtensions.contains(name))
- return true;
-
- if (m_requestableExtensions.contains(name)) {
- m_context->requestExtensionCHROMIUM(name.ascii().data());
- m_enabledExtensions.clear();
- m_requestableExtensions.clear();
- initializeExtensions();
- }
- return m_enabledExtensions.contains(name);
-}
-
-bool Extensions3DUtil::isExtensionEnabled(const String& name)
-{
- return m_enabledExtensions.contains(name);
-}
-
-bool Extensions3DUtil::canUseCopyTextureCHROMIUM(GLenum destFormat, GLenum destType, GLint level)
-{
- // FIXME: restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be lifted when
- // WebGraphicsContext3D::copyTextureCHROMIUM(...) are fully functional.
- if ((destFormat == GL_RGB || destFormat == GL_RGBA)
- && destType == GL_UNSIGNED_BYTE
- && !level)
- return true;
- return false;
-}
-
-} // namespace blink
« no previous file with comments | « sky/engine/platform/graphics/gpu/Extensions3DUtil.h ('k') | sky/engine/platform/graphics/gpu/WebGLImageBufferSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698