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

Side by Side Diff: ui/gl/gl_context_nsview.h

Issue 56833002: Add a basic NativeViewportMac for Mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address ben's feedback Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « ui/gl/gl_context_mac.mm ('k') | ui/gl/gl_context_nsview.mm » ('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 #ifndef UI_GL_GL_CONTEXT_NSVIEW_H_ 5 #ifndef UI_GL_GL_CONTEXT_NSVIEW_H_
6 #define UI_GL_GL_CONTEXT_NSVIEW_H_ 6 #define UI_GL_GL_CONTEXT_NSVIEW_H_
7 7
8 #import <AppKit/NSOpenGL.h> 8 #import <AppKit/NSOpenGL.h>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/mac/scoped_nsobject.h" 11 #include "base/mac/scoped_nsobject.h"
12 #include "ui/gl/gl_context.h" 12 #include "ui/gl/gl_context.h"
13 13
14 namespace gfx { 14 namespace gfx {
15 15
16 class GLSurface; 16 class GLSurface;
17 17
18 // GLContextNSView encapsulates an NSView-based GLContext. This is paired with 18 // GLContextNSView encapsulates an NSView-based GLContext. This is paired with
19 // the GLSurfaceNSView class. 19 // the GLSurfaceNSView class.
20 class GLContextNSView : public GLContextReal { 20 class GLContextNSView : public GLContextReal {
21 public: 21 public:
22 explicit GLContextNSView(GLShareGroup* group); 22 explicit GLContextNSView(GLShareGroup* group);
23 virtual ~GLContextNSView();
24 23
25 // GLContext: 24 // GLContext:
26 virtual bool Initialize(GLSurface* surface, 25 virtual bool Initialize(GLSurface* surface,
27 GpuPreference gpu_preference) OVERRIDE; 26 GpuPreference gpu_preference) OVERRIDE;
28 virtual void Destroy() OVERRIDE; 27 virtual void Destroy() OVERRIDE;
29 virtual bool MakeCurrent(GLSurface* surface) OVERRIDE; 28 virtual bool MakeCurrent(GLSurface* surface) OVERRIDE;
30 virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE; 29 virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE;
31 virtual bool IsCurrent(GLSurface* surface) OVERRIDE; 30 virtual bool IsCurrent(GLSurface* surface) OVERRIDE;
32 virtual void* GetHandle() OVERRIDE; 31 virtual void* GetHandle() OVERRIDE;
33 virtual void SetSwapInterval(int interval) OVERRIDE; 32 virtual void SetSwapInterval(int interval) OVERRIDE;
34 33
35 // Flush the |context_|. Swaps buffers. 34 // Flush the |context_|. Swaps buffers.
36 void FlushBuffer(); 35 void FlushBuffer();
37 36
38 private: 37 private:
38 virtual ~GLContextNSView();
39
39 base::scoped_nsobject<NSOpenGLContext> context_; 40 base::scoped_nsobject<NSOpenGLContext> context_;
40 GpuPreference gpu_preference_; 41 GpuPreference gpu_preference_;
41 42
42 DISALLOW_COPY_AND_ASSIGN(GLContextNSView); 43 DISALLOW_COPY_AND_ASSIGN(GLContextNSView);
43 }; 44 };
44 45
45 } // namespace gfx 46 } // namespace gfx
46 47
47 #endif // UI_GL_GL_CONTEXT_NSVIEW_H_ 48 #endif // UI_GL_GL_CONTEXT_NSVIEW_H_
OLDNEW
« no previous file with comments | « ui/gl/gl_context_mac.mm ('k') | ui/gl/gl_context_nsview.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698