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

Side by Side Diff: ui/gl/gl_surface_nsview.mm

Issue 227473009: Mac: Remove NSView support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ui/gl/gl_surface_nsview.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "ui/gl/gl_surface_nsview.h"
6
7 #import <AppKit/NSOpenGL.h>
8 #import <AppKit/NSView.h>
9
10 #include "base/debug/trace_event.h"
11 #include "ui/gl/gl_context_nsview.h"
12
13 namespace gfx {
14
15 GLSurfaceNSView::GLSurfaceNSView(AcceleratedWidget view)
16 : view_(view),
17 context_(NULL) {
18 }
19
20 GLSurfaceNSView::~GLSurfaceNSView() {
21 }
22
23 void GLSurfaceNSView::Destroy() {
24 }
25
26 bool GLSurfaceNSView::IsOffscreen() {
27 return false;
28 }
29
30 bool GLSurfaceNSView::SwapBuffers() {
31 TRACE_EVENT2("gpu", "GLSurfaceNSView:RealSwapBuffers",
32 "width", GetSize().width(),
33 "height", GetSize().height());
34 context_->FlushBuffer();
35 return true;
36 }
37
38 gfx::Size GLSurfaceNSView::GetSize() {
39 return gfx::Size(NSSizeToCGSize([view_ bounds].size));
40 }
41
42 void* GLSurfaceNSView::GetHandle() {
43 return view_;
44 }
45
46 bool GLSurfaceNSView::OnMakeCurrent(GLContext* context) {
47 context_ = static_cast<GLContextNSView *>(context);
48 return true;
49 }
50
51 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_surface_nsview.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698