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

Side by Side Diff: ui/gl/gl_surface_mac.cc

Issue 667923002: Standardize usage of virtual/override/final in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « ui/gl/gl_surface_egl.h ('k') | ui/gl/gl_surface_osmesa.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/gl/gl_surface.h" 5 #include "ui/gl/gl_surface.h"
6 6
7 #include <OpenGL/CGLRenderers.h> 7 #include <OpenGL/CGLRenderers.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 12 matching lines...) Expand all
23 23
24 // A "no-op" surface. It is not required that a CGLContextObj have an 24 // A "no-op" surface. It is not required that a CGLContextObj have an
25 // associated drawable (pbuffer or fullscreen context) in order to be 25 // associated drawable (pbuffer or fullscreen context) in order to be
26 // made current. Everywhere this surface type is used, we allocate an 26 // made current. Everywhere this surface type is used, we allocate an
27 // FBO at the user level as the drawable of the associated context. 27 // FBO at the user level as the drawable of the associated context.
28 class GL_EXPORT NoOpGLSurface : public GLSurface { 28 class GL_EXPORT NoOpGLSurface : public GLSurface {
29 public: 29 public:
30 explicit NoOpGLSurface(const gfx::Size& size) : size_(size) {} 30 explicit NoOpGLSurface(const gfx::Size& size) : size_(size) {}
31 31
32 // Implement GLSurface. 32 // Implement GLSurface.
33 virtual bool Initialize() override { return true; } 33 bool Initialize() override { return true; }
34 virtual void Destroy() override {} 34 void Destroy() override {}
35 virtual bool IsOffscreen() override { return true; } 35 bool IsOffscreen() override { return true; }
36 virtual bool SwapBuffers() override { 36 bool SwapBuffers() override {
37 NOTREACHED() << "Cannot call SwapBuffers on a NoOpGLSurface."; 37 NOTREACHED() << "Cannot call SwapBuffers on a NoOpGLSurface.";
38 return false; 38 return false;
39 } 39 }
40 virtual gfx::Size GetSize() override { return size_; } 40 gfx::Size GetSize() override { return size_; }
41 virtual void* GetHandle() override { return NULL; } 41 void* GetHandle() override { return NULL; }
42 virtual void* GetDisplay() override { return NULL; } 42 void* GetDisplay() override { return NULL; }
43 virtual bool IsSurfaceless() const override { return true; } 43 bool IsSurfaceless() const override { return true; }
44 44
45 protected: 45 protected:
46 virtual ~NoOpGLSurface() {} 46 ~NoOpGLSurface() override {}
47 47
48 private: 48 private:
49 gfx::Size size_; 49 gfx::Size size_;
50 50
51 DISALLOW_COPY_AND_ASSIGN(NoOpGLSurface); 51 DISALLOW_COPY_AND_ASSIGN(NoOpGLSurface);
52 }; 52 };
53 53
54 // static 54 // static
55 bool InitializeOneOffForSandbox() { 55 bool InitializeOneOffForSandbox() {
56 static bool initialized = false; 56 static bool initialized = false;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 153 }
154 case kGLImplementationMockGL: 154 case kGLImplementationMockGL:
155 return new GLSurfaceStub; 155 return new GLSurfaceStub;
156 default: 156 default:
157 NOTREACHED(); 157 NOTREACHED();
158 return NULL; 158 return NULL;
159 } 159 }
160 } 160 }
161 161
162 } // namespace gfx 162 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_surface_egl.h ('k') | ui/gl/gl_surface_osmesa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698