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

Side by Side Diff: cc/grcontext_provider.h

Issue 12212007: cc: Route offscreen context creation for compositor to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove the GrContextProvider::ScopedContexts guard classes Created 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_GRCONTEXT_PROVIDER_H_
6 #define CC_GRCONTEXT_PROVIDER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "cc/cc_export.h"
10
11 class GrContext;
12 namespace WebKit { class WebGraphicsContext3D; }
13
14 namespace cc {
15 class ResourceProvider;
16
17 class CC_EXPORT GrContextProvider {
18 public:
19 GrContextProvider(ResourceProvider* resource_provider);
20 virtual ~GrContextProvider();
21
22 void set_contexts(WebKit::WebGraphicsContext3D* context3d,
23 GrContext* gr_context) {
24 context3d_ = context3d;
25 gr_context_ = gr_context;
26 }
27
28 bool has_contexts() { return context3d_ && gr_context_; }
29
30 WebKit::WebGraphicsContext3D* context3d() {
31 return context3d_;
32 }
33 GrContext* gr_context() {
34 return gr_context_;
35 }
36
37 void BeginUsingContexts();
38 void FinishUsingContexts();
39
40 private:
41 ResourceProvider* resource_provider_;
42 WebKit::WebGraphicsContext3D* context3d_;
43 GrContext* gr_context_;
44 };
45
46 } // namespace cc
47
48 #endif // CC_GRCONTEXT_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698