OLD | NEW |
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 #include "ui/gl/gl_surface_cgl.h" | 5 #include "ui/gl/gl_surface_cgl.h" |
6 | 6 |
7 #include <OpenGL/CGLRenderers.h> | 7 #include <OpenGL/CGLRenderers.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 : size_(size) { | 71 : size_(size) { |
72 } | 72 } |
73 | 73 |
74 bool NoOpGLSurfaceCGL::Initialize() { | 74 bool NoOpGLSurfaceCGL::Initialize() { |
75 return true; | 75 return true; |
76 } | 76 } |
77 | 77 |
78 void NoOpGLSurfaceCGL::Destroy() { | 78 void NoOpGLSurfaceCGL::Destroy() { |
79 } | 79 } |
80 | 80 |
| 81 // bool GLSurfaceNSView::Resize(const gfx::Size& size) { |
| 82 // CGFloat reverse_scale = 1.0 / scaleFactorForView(view_); |
| 83 // gfx::Size view_size = gfx::ToFlooredSize(gfx::ScaleSize(size, |
| 84 // reverse_scale)); |
| 85 // [view_ setFrameSize:NSSizeFromCGSize(view_size.ToCGSize())]; |
| 86 // return true; |
| 87 //} |
| 88 |
81 bool NoOpGLSurfaceCGL::IsOffscreen() { | 89 bool NoOpGLSurfaceCGL::IsOffscreen() { |
82 return true; | 90 return true; |
83 } | 91 } |
84 | 92 |
85 bool NoOpGLSurfaceCGL::SwapBuffers() { | 93 bool NoOpGLSurfaceCGL::SwapBuffers() { |
86 NOTREACHED() << "Cannot call SwapBuffers on a NoOpGLSurfaceCGL."; | 94 NOTREACHED() << "Cannot call SwapBuffers on a NoOpGLSurfaceCGL."; |
87 return false; | 95 return false; |
88 } | 96 } |
89 | 97 |
90 gfx::Size NoOpGLSurfaceCGL::GetSize() { | 98 gfx::Size NoOpGLSurfaceCGL::GetSize() { |
91 return size_; | 99 return size_; |
92 } | 100 } |
93 | 101 |
94 void* NoOpGLSurfaceCGL::GetHandle() { | 102 void* NoOpGLSurfaceCGL::GetHandle() { |
95 return NULL; | 103 return NULL; |
96 } | 104 } |
97 | 105 |
98 void* NoOpGLSurfaceCGL::GetDisplay() { | 106 void* NoOpGLSurfaceCGL::GetDisplay() { |
99 return NULL; | 107 return NULL; |
100 } | 108 } |
101 | 109 |
102 NoOpGLSurfaceCGL::~NoOpGLSurfaceCGL() { | 110 NoOpGLSurfaceCGL::~NoOpGLSurfaceCGL() { |
103 Destroy(); | 111 Destroy(); |
104 } | 112 } |
105 | 113 |
106 } // namespace gfx | 114 } // namespace gfx |
OLD | NEW |