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

Unified Diff: ui/gfx/gl/gl_surface.cc

Issue 6839008: Split EGLContext in GLContextEGL and GLSurfaceEGL. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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
« no previous file with comments | « ui/gfx/gl/gl_surface.h ('k') | ui/gfx/gl/gl_surface_egl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gl/gl_surface.cc
===================================================================
--- ui/gfx/gl/gl_surface.cc (revision 80956)
+++ ui/gfx/gl/gl_surface.cc (working copy)
@@ -2,57 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <string>
+#include "ui/gfx/gl/gl_surface.h"
-#include "base/command_line.h"
-#include "base/logging.h"
-#include "ui/gfx/gl/gl_context.h"
-#include "ui/gfx/gl/gl_bindings.h"
-#include "ui/gfx/gl/gl_implementation.h"
-#include "ui/gfx/gl/gl_switches.h"
-
namespace gfx {
-unsigned int GLContext::GetBackingFrameBufferObject() {
+unsigned int GLSurface::GetBackingFrameBufferObject() {
return 0;
}
-std::string GLContext::GetExtensions() {
- DCHECK(IsCurrent());
- const char* ext = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
- return std::string(ext ? ext : "");
-}
-
-bool GLContext::HasExtension(const char* name) {
- std::string extensions = GetExtensions();
- extensions += " ";
-
- std::string delimited_name(name);
- delimited_name += " ";
-
- return extensions.find(delimited_name) != std::string::npos;
-}
-
-bool GLContext::InitializeCommon() {
- if (!MakeCurrent()) {
- LOG(ERROR) << "MakeCurrent failed.";
- return false;
- }
-
- if (!IsOffscreen()) {
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableGpuVsync))
- SetSwapInterval(0);
- else
- SetSwapInterval(1);
- }
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
- if (glGetError() != GL_NO_ERROR) {
- LOG(ERROR) << "glClear failed.";
- return false;
- }
-
- return true;
-}
-
} // namespace gfx
« no previous file with comments | « ui/gfx/gl/gl_surface.h ('k') | ui/gfx/gl/gl_surface_egl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698