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

Unified Diff: cc/output_surface_impl.cc

Issue 11967033: [CLOSED] In-browser software compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the lack SkCanvas::clear scissoring. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output_surface_impl.h ('k') | cc/software_output_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output_surface_impl.cc
diff --git a/cc/output_surface_impl.cc b/cc/output_surface_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a6782879de27e5cd3f348ef3991dcd65710dfc94
--- /dev/null
+++ b/cc/output_surface_impl.cc
@@ -0,0 +1,60 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/output_surface_impl.h"
+
+#include "base/logging.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h"
+
+namespace cc {
+
+OutputSurfaceImpl::OutputSurfaceImpl(
+ scoped_ptr<WebKit::WebGraphicsContext3D> context3d)
+ : client_(NULL),
+ context3d_(context3d.Pass()) {
+}
+
+OutputSurfaceImpl::OutputSurfaceImpl(
+ scoped_ptr<cc::SoftwareOutputDevice> software_device)
+ : client_(NULL),
+ software_device_(software_device.Pass()) {
+}
+
+OutputSurfaceImpl::OutputSurfaceImpl(
+ scoped_ptr<WebKit::WebGraphicsContext3D> context3d,
+ scoped_ptr<cc::SoftwareOutputDevice> software_device)
+ : client_(NULL),
+ context3d_(context3d.Pass()),
+ software_device_(software_device.Pass()) {
+}
+
+OutputSurfaceImpl::~OutputSurfaceImpl() {}
+
+bool OutputSurfaceImpl::BindToClient(
+ cc::OutputSurfaceClient* client) {
+ DCHECK(client);
+ if (!context3d_)
+ return true;
+ client_ = client;
+ return context3d_->makeContextCurrent();
+}
+
+const struct cc::OutputSurface::Capabilities&
+ OutputSurfaceImpl::Capabilities() const {
+ return capabilities_;
+}
+
+WebKit::WebGraphicsContext3D* OutputSurfaceImpl::Context3D() const {
+ return context3d_.get();
+}
+
+cc::SoftwareOutputDevice* OutputSurfaceImpl::SoftwareDevice() const {
+ return software_device_.get();
+}
+
+void OutputSurfaceImpl::SendFrameToParentCompositor(
+ cc::CompositorFrame*) {
+}
+
+} // namespace cc
« no previous file with comments | « cc/output_surface_impl.h ('k') | cc/software_output_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698