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

Side by Side Diff: gpu/command_buffer/service/gl_context_virtual.h

Issue 1081533003: ui: Enable virtual contexts for linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: yet another merge Created 5 years, 7 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/gl_context_virtual.cc » ('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) 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 #ifndef GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_VIRTUAL_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_VIRTUAL_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_VIRTUAL_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_VIRTUAL_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 13 matching lines...) Expand all
24 } 24 }
25 25
26 // Encapsulates a virtual OpenGL context. 26 // Encapsulates a virtual OpenGL context.
27 class GPU_EXPORT GLContextVirtual : public gfx::GLContext { 27 class GPU_EXPORT GLContextVirtual : public gfx::GLContext {
28 public: 28 public:
29 GLContextVirtual( 29 GLContextVirtual(
30 gfx::GLShareGroup* share_group, 30 gfx::GLShareGroup* share_group,
31 gfx::GLContext* shared_context, 31 gfx::GLContext* shared_context,
32 base::WeakPtr<gles2::GLES2Decoder> decoder); 32 base::WeakPtr<gles2::GLES2Decoder> decoder);
33 33
34 gfx::Display* display();
35
36 // Implement GLContext. 34 // Implement GLContext.
37 bool Initialize(gfx::GLSurface* compatible_surface, 35 bool Initialize(gfx::GLSurface* compatible_surface,
38 gfx::GpuPreference gpu_preference) override; 36 gfx::GpuPreference gpu_preference) override;
39 void Destroy() override; 37 void Destroy() override;
40 bool MakeCurrent(gfx::GLSurface* surface) override; 38 bool MakeCurrent(gfx::GLSurface* surface) override;
41 void ReleaseCurrent(gfx::GLSurface* surface) override; 39 void ReleaseCurrent(gfx::GLSurface* surface) override;
42 bool IsCurrent(gfx::GLSurface* surface) override; 40 bool IsCurrent(gfx::GLSurface* surface) override;
43 void* GetHandle() override; 41 void* GetHandle() override;
44 scoped_refptr<gfx::GPUTimingClient> CreateGPUTimingClient() override; 42 scoped_refptr<gfx::GPUTimingClient> CreateGPUTimingClient() override;
45 void OnSetSwapInterval(int interval) override; 43 void OnSetSwapInterval(int interval) override;
46 std::string GetExtensions() override; 44 std::string GetExtensions() override;
47 bool GetTotalGpuMemory(size_t* bytes) override; 45 bool GetTotalGpuMemory(size_t* bytes) override;
48 void SetSafeToForceGpuSwitch() override; 46 void SetSafeToForceGpuSwitch() override;
49 bool WasAllocatedUsingRobustnessExtension() override; 47 bool WasAllocatedUsingRobustnessExtension() override;
50 void SetUnbindFboOnMakeCurrent() override; 48 void SetUnbindFboOnMakeCurrent() override;
51 base::Closure GetStateWasDirtiedExternallyCallback() override; 49 base::Closure GetStateWasDirtiedExternallyCallback() override;
52 void RestoreStateIfDirtiedExternally() override; 50 void RestoreStateIfDirtiedExternally() override;
53 51
54 protected: 52 protected:
55 ~GLContextVirtual() override; 53 ~GLContextVirtual() override;
56 54
57 private: 55 private:
58 scoped_refptr<gfx::GLContext> shared_context_; 56 scoped_refptr<gfx::GLContext> shared_context_;
59 gfx::Display* display_;
60 base::WeakPtr<gles2::GLES2Decoder> decoder_; 57 base::WeakPtr<gles2::GLES2Decoder> decoder_;
61 58
62 DISALLOW_COPY_AND_ASSIGN(GLContextVirtual); 59 DISALLOW_COPY_AND_ASSIGN(GLContextVirtual);
63 }; 60 };
64 61
65 } // namespace gpu 62 } // namespace gpu
66 63
67 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_VIRTUAL_H_ 64 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_CONTEXT_VIRTUAL_H_
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gl_context_virtual.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698