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
3 // found in the LICENSE file.
5 #include "ui/gl/gl_surface_nsview.h"
7 #import <AppKit/NSOpenGL.h>
8 #import <AppKit/NSView.h>
10 #include "ui/gl/gl_context_nsview.h"
14 GLSurfaceNSView::GLSurfaceNSView(AcceleratedWidget view)
19 GLSurfaceNSView::~GLSurfaceNSView() {
22 void GLSurfaceNSView::Destroy() {
25 bool GLSurfaceNSView::IsOffscreen() {
29 bool GLSurfaceNSView::SwapBuffers() {
30 context_->FlushBuffer();
34 gfx::Size GLSurfaceNSView::GetSize() {
35 return gfx::Size(NSSizeToCGSize([view_ bounds].size));
38 void* GLSurfaceNSView::GetHandle() {
42 bool GLSurfaceNSView::OnMakeCurrent(GLContext* context) {
43 context_ = static_cast<GLContextNSView *>(context);