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

Side by Side Diff: cc/output_surface.cc

Issue 12041062: Have a common implementation of cc::OutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 (c) 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/output_surface.h"
6
7 #include "base/logging.h"
8
9 namespace cc {
10
11 OutputSurface::OutputSurface(
12 scoped_ptr<WebKit::WebGraphicsContext3D> context3d)
13 : client_(NULL),
14 context3d_(context3d.Pass()) {
15 }
16
17 OutputSurface::OutputSurface(
18 scoped_ptr<cc::SoftwareOutputDevice> software_device)
19 : client_(NULL),
20 software_device_(software_device.Pass()) {
21 }
22
23 OutputSurface::OutputSurface(
24 scoped_ptr<WebKit::WebGraphicsContext3D> context3d,
25 scoped_ptr<cc::SoftwareOutputDevice> software_device)
26 : client_(NULL),
27 context3d_(context3d.Pass()),
28 software_device_(software_device.Pass()) {
29 }
30
31 bool OutputSurface::BindToClient(
32 cc::OutputSurfaceClient* client) {
33 DCHECK(client);
34 client_ = client;
35 if (!context3d_)
36 return true;
37 return context3d_->makeContextCurrent();
38 }
39
40 const struct OutputSurface::Capabilities&
41 OutputSurface::Capabilities() const {
42 return capabilities_;
43 }
44
45 WebKit::WebGraphicsContext3D* OutputSurface::Context3D() const {
46 return context3d_.get();
47 }
48
49 cc::SoftwareOutputDevice* OutputSurface::SoftwareDevice() const {
50 return software_device_.get();
51 }
52
53 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698