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

Unified Diff: cc/test/fake_web_compositor_output_surface.h

Issue 11108020: [cc] Change cc_tests.gyp filenames to Chromium style (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 2 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/test/fake_layer_tree_host_client.cc ('k') | cc/test/fake_web_compositor_software_output_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_web_compositor_output_surface.h
diff --git a/cc/test/fake_web_compositor_output_surface.h b/cc/test/fake_web_compositor_output_surface.h
index 638cbb270ce9b24689d5095baf174ade4f4d1a13..179576f54cb09e27e6b772a9252679c9c54eea5d 100644
--- a/cc/test/fake_web_compositor_output_surface.h
+++ b/cc/test/fake_web_compositor_output_surface.h
@@ -1,3 +1,77 @@
// Copyright 2012 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.
+
+#ifndef FakeWebCompositorOutputSurface_h
+#define FakeWebCompositorOutputSurface_h
+
+#include "base/memory/scoped_ptr.h"
+#include "FakeWebCompositorSoftwareOutputDevice.h"
+#include <public/WebCompositorOutputSurface.h>
+#include <public/WebGraphicsContext3D.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebKit {
+
+class FakeWebCompositorOutputSurface : public WebCompositorOutputSurface {
+public:
+ static inline scoped_ptr<FakeWebCompositorOutputSurface> create(PassOwnPtr<WebGraphicsContext3D> context3D)
+ {
+ return make_scoped_ptr(new FakeWebCompositorOutputSurface(context3D));
+ }
+
+ static inline scoped_ptr<FakeWebCompositorOutputSurface> createSoftware(PassOwnPtr<WebCompositorSoftwareOutputDevice> softwareDevice)
+ {
+ return make_scoped_ptr(new FakeWebCompositorOutputSurface(softwareDevice));
+ }
+
+ virtual bool bindToClient(WebCompositorOutputSurfaceClient* client) OVERRIDE
+ {
+ if (!m_context3D)
+ return true;
+ ASSERT(client);
+ if (!m_context3D->makeContextCurrent())
+ return false;
+ m_client = client;
+ return true;
+ }
+
+ virtual const Capabilities& capabilities() const OVERRIDE
+ {
+ return m_capabilities;
+ }
+
+ virtual WebGraphicsContext3D* context3D() const OVERRIDE
+ {
+ return m_context3D.get();
+ }
+ virtual WebCompositorSoftwareOutputDevice* softwareDevice() const OVERRIDE
+ {
+ return m_softwareDevice.get();
+ }
+
+ virtual void sendFrameToParentCompositor(const WebCompositorFrame&) OVERRIDE
+ {
+ }
+
+private:
+ explicit FakeWebCompositorOutputSurface(PassOwnPtr<WebGraphicsContext3D> context3D)
+ {
+ m_context3D = context3D;
+ }
+
+ explicit FakeWebCompositorOutputSurface(PassOwnPtr<WebCompositorSoftwareOutputDevice> softwareDevice)
+ {
+ m_softwareDevice = softwareDevice;
+ }
+
+ OwnPtr<WebGraphicsContext3D> m_context3D;
+ OwnPtr<WebCompositorSoftwareOutputDevice> m_softwareDevice;
+ Capabilities m_capabilities;
+ WebCompositorOutputSurfaceClient* m_client;
+};
+
+} // namespace WebKit
+
+#endif // FakeWebCompositorOutputSurface_h
« no previous file with comments | « cc/test/fake_layer_tree_host_client.cc ('k') | cc/test/fake_web_compositor_software_output_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698