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_context.h" | 5 #include "ui/gl/gl_context.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
10 #include "ui/gl/gl_bindings.h" | 10 #include "ui/gl/gl_bindings.h" |
11 #include "ui/gl/gl_context_egl.h" | 11 #include "ui/gl/gl_context_egl.h" |
12 #include "ui/gl/gl_context_osmesa.h" | 12 #include "ui/gl/gl_context_osmesa.h" |
13 #include "ui/gl/gl_context_stub.h" | 13 #include "ui/gl/gl_context_stub.h" |
14 #include "ui/gl/gl_implementation.h" | 14 #include "ui/gl/gl_implementation.h" |
15 #include "ui/gl/gl_surface.h" | 15 #include "ui/gl/gl_surface.h" |
16 | 16 |
17 namespace gfx { | 17 namespace gfx { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // Used to render into an already current context+surface, | 21 // Used to render into an already current context+surface, |
22 // that we do not have ownership of (draw callback). | 22 // that we do not have ownership of (draw callback). |
23 // TODO(boliu): Make this inherit from GLContextEGL. | 23 // TODO(boliu): Make this inherit from GLContextEGL. |
24 class GLNonOwnedContext : public GLContextReal { | 24 class GLNonOwnedContext : public GLContextReal { |
25 public: | 25 public: |
26 GLNonOwnedContext(GLShareGroup* share_group); | 26 GLNonOwnedContext(GLShareGroup* share_group); |
27 | 27 |
28 // Implement GLContext. | 28 // Implement GLContext. |
29 virtual bool Initialize(GLSurface* compatible_surface, | 29 virtual bool Initialize(GLSurface* compatible_surface, |
30 GpuPreference gpu_preference) OVERRIDE; | 30 GpuPreference gpu_preference) override; |
31 virtual void Destroy() OVERRIDE {} | 31 virtual void Destroy() override {} |
32 virtual bool MakeCurrent(GLSurface* surface) OVERRIDE; | 32 virtual bool MakeCurrent(GLSurface* surface) override; |
33 virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE {} | 33 virtual void ReleaseCurrent(GLSurface* surface) override {} |
34 virtual bool IsCurrent(GLSurface* surface) OVERRIDE { return true; } | 34 virtual bool IsCurrent(GLSurface* surface) override { return true; } |
35 virtual void* GetHandle() OVERRIDE { return NULL; } | 35 virtual void* GetHandle() override { return NULL; } |
36 virtual void SetSwapInterval(int interval) OVERRIDE {} | 36 virtual void SetSwapInterval(int interval) override {} |
37 virtual std::string GetExtensions() OVERRIDE; | 37 virtual std::string GetExtensions() override; |
38 | 38 |
39 protected: | 39 protected: |
40 virtual ~GLNonOwnedContext() {} | 40 virtual ~GLNonOwnedContext() {} |
41 | 41 |
42 private: | 42 private: |
43 DISALLOW_COPY_AND_ASSIGN(GLNonOwnedContext); | 43 DISALLOW_COPY_AND_ASSIGN(GLNonOwnedContext); |
44 | 44 |
45 EGLDisplay display_; | 45 EGLDisplay display_; |
46 }; | 46 }; |
47 | 47 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // increased the limit to 12 (8MB, or 12MB in emergencies). | 144 // increased the limit to 12 (8MB, or 12MB in emergencies). |
145 limit_bytes = 12; | 145 limit_bytes = 12; |
146 } | 146 } |
147 limit_bytes = limit_bytes * 1024 * 1024; | 147 limit_bytes = limit_bytes * 1024 * 1024; |
148 } | 148 } |
149 *bytes = limit_bytes; | 149 *bytes = limit_bytes; |
150 return true; | 150 return true; |
151 } | 151 } |
152 | 152 |
153 } | 153 } |
OLD | NEW |