OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ui/gfx/gl/gl_surface_nsview.h" | |
6 | |
7 #import <AppKit/NSView.h> | |
8 | |
9 #include "base/basictypes.h" | |
10 #include "base/logging.h" | |
11 #include "base/mac/mac_util.h" | |
12 #include "ui/gfx/gl/gl_bindings.h" | |
13 #include "ui/gfx/gl/gl_context.h" | |
14 | |
15 namespace gfx { | |
16 | |
17 GLSurfaceNSView::GLSurfaceNSView(PluginWindowHandle view) | |
18 : view_(view) { | |
19 } | |
20 | |
21 GLSurfaceNSView::~GLSurfaceNSView() { | |
22 } | |
23 | |
24 void GLSurfaceNSView::Destroy() { | |
25 } | |
26 | |
27 bool GLSurfaceNSView::IsOffscreen() { | |
28 return false; | |
29 } | |
30 | |
31 bool GLSurfaceNSView::SwapBuffers() { | |
32 CGLContextObj cgl_context = CGLGetCurrentContext(); | |
33 CGLFlushDrawable(cgl_context); | |
Ken Russell (switch to Gerrit)
2011/11/17 00:14:40
I don't think it's valid to assume that flushing t
dhollowa
2011/11/17 01:41:51
Done. I went with the weak pointer approach. It
| |
34 return true; | |
35 } | |
36 | |
37 gfx::Size GLSurfaceNSView::GetSize() { | |
38 return gfx::Size(NSSizeToCGSize([view_ bounds].size)); | |
39 } | |
40 | |
41 void* GLSurfaceNSView::GetHandle() { | |
42 return view_; | |
43 } | |
44 | |
45 } // namespace gfx | |
OLD | NEW |