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

Side by Side Diff: mojo/gpu/gl_context.h

Issue 1682113003: Mojo C++ bindings: Generate InterfaceHandle<> instead of InterfacePtr<>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase ontop of master, address trung's comments Created 4 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
« no previous file with comments | « mojo/gles2/command_buffer_client_impl.cc ('k') | mojo/gpu/gl_context.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 MOJO_GPU_GL_CONTEXT_H_ 5 #ifndef MOJO_GPU_GL_CONTEXT_H_
6 #define MOJO_GPU_GL_CONTEXT_H_ 6 #define MOJO_GPU_GL_CONTEXT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
(...skipping 15 matching lines...) Expand all
26 protected: 26 protected:
27 virtual ~Observer(); 27 virtual ~Observer();
28 }; 28 };
29 29
30 // Creates an offscreen GL context. 30 // Creates an offscreen GL context.
31 static base::WeakPtr<GLContext> CreateOffscreen( 31 static base::WeakPtr<GLContext> CreateOffscreen(
32 ApplicationConnector* connector); 32 ApplicationConnector* connector);
33 33
34 // Creates a GL context from a command buffer. 34 // Creates a GL context from a command buffer.
35 static base::WeakPtr<GLContext> CreateFromCommandBuffer( 35 static base::WeakPtr<GLContext> CreateFromCommandBuffer(
36 CommandBufferPtr command_buffer); 36 InterfaceHandle<CommandBuffer> command_buffer);
37 37
38 void MakeCurrent(); 38 void MakeCurrent();
39 bool IsCurrent(); 39 bool IsCurrent();
40 void Destroy(); 40 void Destroy();
41 41
42 void AddObserver(Observer* observer); 42 void AddObserver(Observer* observer);
43 void RemoveObserver(Observer* observer); 43 void RemoveObserver(Observer* observer);
44 44
45 private: 45 private:
46 explicit GLContext(CommandBufferPtr command_buffer); 46 explicit GLContext(InterfaceHandle<CommandBuffer> command_buffer);
47 ~GLContext(); 47 ~GLContext();
48 48
49 static void ContextLostThunk(void* self); 49 static void ContextLostThunk(void* self);
50 void OnContextLost(); 50 void OnContextLost();
51 51
52 MGLContext context_; 52 MGLContext context_;
53 53
54 base::ObserverList<Observer> observers_; 54 base::ObserverList<Observer> observers_;
55 base::WeakPtrFactory<GLContext> weak_factory_; 55 base::WeakPtrFactory<GLContext> weak_factory_;
56 56
57 DISALLOW_COPY_AND_ASSIGN(GLContext); 57 DISALLOW_COPY_AND_ASSIGN(GLContext);
58 }; 58 };
59 59
60 } // namespace mojo 60 } // namespace mojo
61 61
62 #endif // MOJO_GPU_GL_CONTEXT_H_ 62 #endif // MOJO_GPU_GL_CONTEXT_H_
OLDNEW
« no previous file with comments | « mojo/gles2/command_buffer_client_impl.cc ('k') | mojo/gpu/gl_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698