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

Side by Side Diff: ui/gfx/gl/gl_context_nsview.mm

Issue 9160012: Change PluginWindowHandle to AcceleratedWidget in ui/gfx/gl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops mac Created 8 years, 10 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/gfx/compositor/compositor.cc ('k') | ui/gfx/gl/gl_surface.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) 2011 The Chromium Authors. All rights reserved. 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 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/gfx/gl/gl_context_nsview.h" 5 #include "ui/gfx/gl/gl_context_nsview.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #import <AppKit/NSOpenGL.h> 9 #import <AppKit/NSOpenGL.h>
10 #import <AppKit/NSView.h> 10 #import <AppKit/NSView.h>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 return true; 49 return true;
50 } 50 }
51 51
52 void GLContextNSView::Destroy() { 52 void GLContextNSView::Destroy() {
53 context_.reset(nil); 53 context_.reset(nil);
54 } 54 }
55 55
56 bool GLContextNSView::MakeCurrent(GLSurface* surface) { 56 bool GLContextNSView::MakeCurrent(GLSurface* surface) {
57 PluginWindowHandle view = 57 AcceleratedWidget view =
58 static_cast<PluginWindowHandle>(surface->GetHandle()); 58 static_cast<AcceleratedWidget>(surface->GetHandle());
59 // Only set the context's view if the view is parented. 59 // Only set the context's view if the view is parented.
60 // I.e. it is a valid drawable. 60 // I.e. it is a valid drawable.
61 if ([view window]) 61 if ([view window])
62 [context_ setView:view]; 62 [context_ setView:view];
63 [context_ makeCurrentContext]; 63 [context_ makeCurrentContext];
64 64
65 SetCurrent(this, surface); 65 SetCurrent(this, surface);
66 66
67 if (!surface->OnMakeCurrent(this)) { 67 if (!surface->OnMakeCurrent(this)) {
68 LOG(ERROR) << "Unable to make gl context current."; 68 LOG(ERROR) << "Unable to make gl context current.";
(...skipping 19 matching lines...) Expand all
88 DCHECK(interval == 0 || interval == 1); 88 DCHECK(interval == 0 || interval == 1);
89 GLint swap = interval; 89 GLint swap = interval;
90 [context_ setValues:&swap forParameter:NSOpenGLCPSwapInterval]; 90 [context_ setValues:&swap forParameter:NSOpenGLCPSwapInterval];
91 } 91 }
92 92
93 void GLContextNSView::FlushBuffer() { 93 void GLContextNSView::FlushBuffer() {
94 [context_ flushBuffer]; 94 [context_ flushBuffer];
95 } 95 }
96 96
97 } // namespace gfx 97 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/compositor/compositor.cc ('k') | ui/gfx/gl/gl_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698