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

Side by Side Diff: mojo/skia/ganesh_context.h

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch Created 5 years, 9 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
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_SKIA_GANESH_CONTEXT_H_ 5 #ifndef MOJO_SKIA_GANESH_CONTEXT_H_
6 #define MOJO_SKIA_GANESH_CONTEXT_H_ 6 #define MOJO_SKIA_GANESH_CONTEXT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "mojo/gpu/gl_context.h" 10 #include "mojo/gpu/gl_context.h"
(...skipping 13 matching lines...) Expand all
24 class Scope { 24 class Scope {
25 public: 25 public:
26 explicit Scope(GaneshContext*); 26 explicit Scope(GaneshContext*);
27 ~Scope(); 27 ~Scope();
28 28
29 private: 29 private:
30 gpu::gles2::GLES2Interface* previous_; 30 gpu::gles2::GLES2Interface* previous_;
31 }; 31 };
32 32
33 explicit GaneshContext(base::WeakPtr<GLContext> gl_context); 33 explicit GaneshContext(base::WeakPtr<GLContext> gl_context);
34 ~GaneshContext(); 34 ~GaneshContext() override;
35 35
36 // Note: You must be in a GaneshContext::Scope to use GrContext. 36 // Note: You must be in a GaneshContext::Scope to use GrContext.
37 GrContext* gr() const { 37 GrContext* gr() const {
38 DCHECK(InScope()); 38 DCHECK(InScope());
39 return context_.get(); 39 return context_.get();
40 } 40 }
41 41
42 private: 42 private:
43 bool InScope() const; 43 bool InScope() const;
44 void OnContextLost() override; 44 void OnContextLost() override;
45 45
46 base::WeakPtr<GLContext> gl_context_; 46 base::WeakPtr<GLContext> gl_context_;
47 skia::RefPtr<GrContext> context_; 47 skia::RefPtr<GrContext> context_;
48 48
49 DISALLOW_COPY_AND_ASSIGN(GaneshContext); 49 DISALLOW_COPY_AND_ASSIGN(GaneshContext);
50 }; 50 };
51 51
52 } // namespace mojo 52 } // namespace mojo
53 53
54 #endif // MOJO_SKIA_GANESH_CONTEXT_H_ 54 #endif // MOJO_SKIA_GANESH_CONTEXT_H_
OLDNEW
« no previous file with comments | « mojo/services/view_manager/public/cpp/view_tracker.h ('k') | mojo/tools/package_manager/package_manager_application.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698