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

Side by Side Diff: cc/ganesh_resource_provider.cc

Issue 12212007: cc: Route offscreen context creation for compositor to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Back to a single OffscreenContext class 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 #include "cc/ganesh_resource_provider.h"
6
7 #include "cc/resource_provider.h"
8 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h"
9 #include "third_party/skia/include/gpu/GrContext.h"
10
11 namespace cc {
12
13 GaneshResourceProvider::GaneshResourceProvider()
14 : context3d_(NULL),
15 gr_context_(NULL) {
16 }
17
18 GaneshResourceProvider::~GaneshResourceProvider() {}
19
20 GaneshResourceProvider::ScopedContexts::ScopedContexts(
21 GaneshResourceProvider* ganesh_resource_provider)
22 : ganesh_resource_provider_(ganesh_resource_provider) {
23 }
24
25 GaneshResourceProvider::ScopedContexts::~ScopedContexts() {}
26
27 GaneshResourceProvider::ScopedContextsFlushed::ScopedContextsFlushed(
28 ResourceProvider* resource_provider,
29 GaneshResourceProvider* ganesh_resource_provider)
30 : ScopedContexts(ganesh_resource_provider) {
31 resource_provider->flush();
32 }
33
34 GaneshResourceProvider::ScopedContextsFlushed::~ScopedContextsFlushed() {
35 // Flush ganesh context so that all the rendered stuff appears on the
36 // texture.
37 if (gr_context()) gr_context()->flush();
piman 2013/02/11 18:45:33 nit: statement goes onto next line.
danakj 2013/02/11 18:58:13 Done.
38 // Flush the GL context so rendering results from this context are
39 // visible in the compositor's context.
40 if (context3d()) context3d()->flush();
piman 2013/02/11 18:45:33 nit: statement goes onto next line.
danakj 2013/02/11 18:58:13 Done.
41 }
42
43 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698