From a4b20ed4917f1f6fc83b6375a48e2c3895d43a8a Mon Sep 17 00:00:00 2001 From: "thakis@chromium.org" Date: Fri, 8 Jul 2011 07:13:51 +0000 Subject: Add chromium_code: 1 to surface.gyp and gl.gyp to pick up -Werror. It looks like this was dropped accidentally in http://codereview.chromium.org/6718027 (surface.gyp) and http://codereview.chromium.org/6722026 (gl.gyp) Remove now-redudant code that's implied by chromium_code: 1. Fix the warnings that have crept in since chromium_code: 1 was removed. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=91598 Review URL: http://codereview.chromium.org/7227009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91813 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/gfx/gl/gl.gyp | 32 ++++---------------------------- ui/gfx/gl/gl_bindings_skia_in_process.cc | 3 +++ ui/gfx/gl/gl_context_glx.cc | 8 +++----- ui/gfx/gl/gl_surface_cgl.cc | 1 - ui/gfx/gl/gl_surface_glx.cc | 4 ++-- ui/gfx/surface/surface.gyp | 28 ++++------------------------ 6 files changed, 16 insertions(+), 60 deletions(-) (limited to 'ui') diff --git a/ui/gfx/gl/gl.gyp b/ui/gfx/gl/gl.gyp index 5da7cf3..2685fbf 100644 --- a/ui/gfx/gl/gl.gyp +++ b/ui/gfx/gl/gl.gyp @@ -3,34 +3,10 @@ # found in the LICENSE file. { - 'target_defaults': { - 'sources/': [ - ['exclude', '/(cocoa|gtk|win)/'], - ['exclude', '_(cocoa|gtk|linux|mac|posix|win|x)\\.(cc|mm?)$'], - ['exclude', '/(gtk|win|x11)_[^/]*\\.cc$'], - ], - 'conditions': [ - ['toolkit_uses_gtk == 1', {'sources/': [ - ['include', '/gtk/'], - ['include', '_(gtk|linux|posix|skia|x)\\.cc$'], - ['include', '/(gtk|x11)_[^/]*\\.cc$'], - ]}], - ['OS=="mac"', {'sources/': [ - ['include', '/cocoa/'], - ['include', '_(cocoa|mac|posix)\\.(cc|mm?)$'], - ]}, { # else: OS != "mac" - 'sources/': [ - ['exclude', '\\.mm?$'], - ], - }], - ['OS=="win"', - {'sources/': [ - ['include', '_(win)\\.cc$'], - ['include', '/win/'], - ['include', '/win_[^/]*\\.cc$'], - ]}], - ], + 'variables': { + 'chromium_code': 1, }, + 'targets': [ { 'target_name': 'gl', @@ -181,4 +157,4 @@ ], }, ], -} \ No newline at end of file +} diff --git a/ui/gfx/gl/gl_bindings_skia_in_process.cc b/ui/gfx/gl/gl_bindings_skia_in_process.cc index 9f509bd..39fdcf3 100644 --- a/ui/gfx/gl/gl_bindings_skia_in_process.cc +++ b/ui/gfx/gl/gl_bindings_skia_in_process.cc @@ -456,6 +456,9 @@ void BindSkiaToInProcessGL() { case gfx::kGLImplementationMockGL: NOTREACHED(); return; + default: + NOTREACHED(); + return; } static GrGLInterface host_gl_interface = { diff --git a/ui/gfx/gl/gl_context_glx.cc b/ui/gfx/gl/gl_context_glx.cc index 1b1a355..ba8d7ab 100644 --- a/ui/gfx/gl/gl_context_glx.cc +++ b/ui/gfx/gl/gl_context_glx.cc @@ -33,13 +33,13 @@ bool IsCompositingWindowManagerActive(Display* display) { // The X macro "None" has been undefined by gl_bindings.h. const int kNone = 0; static Atom net_wm_cm_s0 = kNone; - if (net_wm_cm_s0 == kNone) { + if (net_wm_cm_s0 == static_cast(kNone)) { net_wm_cm_s0 = XInternAtom(display, "_NET_WM_CM_S0", True); } - if (net_wm_cm_s0 == kNone) { + if (net_wm_cm_s0 == static_cast(kNone)) { return false; } - return XGetSelectionOwner(display, net_wm_cm_s0) != kNone; + return XGetSelectionOwner(display, net_wm_cm_s0) != static_cast(kNone); } } // namespace anonymous @@ -124,8 +124,6 @@ bool GLContextGLX::MakeCurrent(GLSurface* surface) { if (IsCurrent(surface)) return true; - GLSurfaceGLX* surface_glx = static_cast(surface); - if (!glXMakeCurrent( GLSurfaceGLX::GetDisplay(), reinterpret_cast(surface->GetHandle()), diff --git a/ui/gfx/gl/gl_surface_cgl.cc b/ui/gfx/gl/gl_surface_cgl.cc index 7b6b89c..ec14cfc 100644 --- a/ui/gfx/gl/gl_surface_cgl.cc +++ b/ui/gfx/gl/gl_surface_cgl.cc @@ -29,7 +29,6 @@ bool GLSurfaceCGL::InitializeOneOff() { (CGLPixelFormatAttribute) kCGLPFAPBuffer, (CGLPixelFormatAttribute) 0 }; - CGLPixelFormatObj pixel_format; GLint num_pixel_formats; if (CGLChoosePixelFormat(attribs, &g_pixel_format, diff --git a/ui/gfx/gl/gl_surface_glx.cc b/ui/gfx/gl/gl_surface_glx.cc index e3058d9..5a051de 100644 --- a/ui/gfx/gl/gl_surface_glx.cc +++ b/ui/gfx/gl/gl_surface_glx.cc @@ -111,8 +111,8 @@ void* NativeViewGLSurfaceGLX::GetConfig() { PbufferGLSurfaceGLX::PbufferGLSurfaceGLX(const gfx::Size& size) : size_(size), - pbuffer_(0), - config_(NULL) { + config_(NULL), + pbuffer_(0) { } PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { diff --git a/ui/gfx/surface/surface.gyp b/ui/gfx/surface/surface.gyp index 960e148..a4e0122 100644 --- a/ui/gfx/surface/surface.gyp +++ b/ui/gfx/surface/surface.gyp @@ -3,37 +3,17 @@ # found in the LICENSE file. { + 'variables': { + 'chromium_code': 1, + }, + 'target_defaults': { - 'sources/': [ - ['exclude', '/(cocoa|gtk|win)/'], - ['exclude', '_(cocoa|gtk|linux|mac|posix|win|x)\\.(cc|mm?)$'], - ['exclude', '/(gtk|win|x11)_[^/]*\\.cc$'], - ], 'conditions': [ ['toolkit_uses_gtk == 1', { - 'sources/': [ - ['include', '/gtk/'], - ['include', '_(gtk|linux|posix|skia|x)\\.cc$'], - ['include', '/(gtk|x11)_[^/]*\\.cc$'], - ], 'include_dirs': [ '<(DEPTH)/third_party/angle/include', ], }], - ['OS=="mac"', {'sources/': [ - ['include', '/cocoa/'], - ['include', '_(cocoa|mac|posix)\\.(cc|mm?)$'], - ]}, { # else: OS != "mac" - 'sources/': [ - ['exclude', '\\.mm?$'], - ], - }], - ['OS=="win"', - {'sources/': [ - ['include', '_(win)\\.cc$'], - ['include', '/win/'], - ['include', '/win_[^/]*\\.cc$'], - ]}], ], }, 'targets': [ -- cgit v1.1