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

Unified Diff: ui/gl/gl_surface.cc

Issue 2616723002: Refactor GL surface format handling (Closed)
Patch Set: Created 3 years, 11 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: ui/gl/gl_surface.cc
diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc
index 7fcb093c9f6434d524d5f4d41f9b90f87c68b546..70f2207150e1915546efe462b716a17e5eae0697 100644
--- a/ui/gl/gl_surface.cc
+++ b/ui/gl/gl_surface.cc
@@ -16,6 +16,7 @@
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_image.h"
#include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_surface_format.h"
#include "ui/gl/gl_switches.h"
namespace gl {
@@ -28,10 +29,10 @@ base::LazyInstance<base::ThreadLocalPointer<GLSurface> >::Leaky
GLSurface::GLSurface() {}
bool GLSurface::Initialize() {
- return Initialize(SURFACE_DEFAULT);
+ return Initialize(GLSurfaceFormat());
}
-bool GLSurface::Initialize(GLSurface::Format format) {
+bool GLSurface::Initialize(GLSurfaceFormat format) {
return true;
}
@@ -134,9 +135,9 @@ unsigned long GLSurface::GetCompatibilityKey() {
return 0;
}
-GLSurface::Format GLSurface::GetFormat() {
+GLSurfaceFormat GLSurface::GetFormat() {
NOTIMPLEMENTED();
- return SURFACE_DEFAULT;
+ return GLSurfaceFormat();
}
gfx::VSyncProvider* GLSurface::GetVSyncProvider() {
@@ -205,7 +206,7 @@ void GLSurface::OnSetSwapInterval(int interval) {
GLSurfaceAdapter::GLSurfaceAdapter(GLSurface* surface) : surface_(surface) {}
-bool GLSurfaceAdapter::Initialize(GLSurface::Format format) {
+bool GLSurfaceAdapter::Initialize(GLSurfaceFormat format) {
return surface_->Initialize(format);
}
@@ -328,7 +329,7 @@ unsigned long GLSurfaceAdapter::GetCompatibilityKey() {
return surface_->GetCompatibilityKey();
}
-GLSurface::Format GLSurfaceAdapter::GetFormat() {
+GLSurfaceFormat GLSurfaceAdapter::GetFormat() {
return surface_->GetFormat();
}
@@ -359,12 +360,17 @@ bool GLSurfaceAdapter::BuffersFlipped() const {
GLSurfaceAdapter::~GLSurfaceAdapter() {}
-scoped_refptr<GLSurface> InitializeGLSurface(scoped_refptr<GLSurface> surface) {
- if (!surface->Initialize())
bajones 2017/01/04 22:31:55 Nit: This function doesn't actually need to change
klausw 2017/01/05 00:55:13 I needed a new Initialize..WithFormat, and I don't
+scoped_refptr<GLSurface> InitializeGLSurfaceWithFormat(
+ scoped_refptr<GLSurface> surface, GLSurfaceFormat format) {
+ if (!surface->Initialize(format))
return nullptr;
return surface;
}
+scoped_refptr<GLSurface> InitializeGLSurface(scoped_refptr<GLSurface> surface) {
+ return InitializeGLSurfaceWithFormat(surface, GLSurfaceFormat());
+}
+
GLSurface::CALayerInUseQuery::CALayerInUseQuery() = default;
GLSurface::CALayerInUseQuery::CALayerInUseQuery(const CALayerInUseQuery&) =
default;
« no previous file with comments | « ui/gl/gl_surface.h ('k') | ui/gl/gl_surface_egl.h » ('j') | ui/gl/gl_surface_egl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698