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

Unified Diff: cc/test/fake_output_surface.h

Issue 11348371: cc: Move WebCompositorOutputSurface and related classes into cc/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: forlanding6 Created 8 years 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_output_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_output_surface.h
diff --git a/cc/test/fake_output_surface.h b/cc/test/fake_output_surface.h
index 69bce1934d3269ceaa2c14d8876b0ee9d64e09af..1150b05b0619bb11f1737f79586db405a468058e 100644
--- a/cc/test/fake_output_surface.h
+++ b/cc/test/fake_output_surface.h
@@ -5,18 +5,59 @@
#ifndef CC_TEST_FAKE_OUTPUT_SURFACE_H_
#define CC_TEST_FAKE_OUTPUT_SURFACE_H_
+#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
#include "cc/output_surface.h"
#include "cc/test/compositor_fake_web_graphics_context_3d.h"
-#include "cc/test/fake_web_compositor_output_surface.h"
-#include <public/WebCompositorOutputSurface.h>
+#include "cc/test/fake_software_output_device.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h"
namespace cc {
+class FakeOutputSurface : public OutputSurface {
+ public:
+ virtual ~FakeOutputSurface();
+
+ static inline scoped_ptr<FakeOutputSurface> Create3d(
+ scoped_ptr<WebKit::WebGraphicsContext3D> context3d) {
+ return make_scoped_ptr(new FakeOutputSurface(context3d.Pass()));
+ }
+
+ static inline scoped_ptr<FakeOutputSurface> CreateSoftware(
+ scoped_ptr<SoftwareOutputDevice> software_device) {
+ return make_scoped_ptr(new FakeOutputSurface(software_device.Pass()));
+ }
+
+ virtual bool BindToClient(OutputSurfaceClient* client) OVERRIDE;
+
+ virtual const struct Capabilities& Capabilities() const OVERRIDE;
+
+ virtual WebKit::WebGraphicsContext3D* Context3D() const OVERRIDE;
+ virtual SoftwareOutputDevice* SoftwareDevice() const OVERRIDE;
+
+ virtual void SendFrameToParentCompositor(const CompositorFrame&) OVERRIDE;
+
+private:
+ explicit FakeOutputSurface(
+ scoped_ptr<WebKit::WebGraphicsContext3D> context3d);
+ explicit FakeOutputSurface(
+ scoped_ptr<SoftwareOutputDevice> software_device);
+
+ scoped_ptr<WebKit::WebGraphicsContext3D> context3d_;
+ scoped_ptr<SoftwareOutputDevice> software_device_;
+ struct Capabilities capabilities_;
+ OutputSurfaceClient* client_;
+};
+
static inline scoped_ptr<cc::OutputSurface> createFakeOutputSurface()
{
- return WebKit::FakeWebCompositorOutputSurface::create(WebKit::CompositorFakeWebGraphicsContext3D::create(WebKit::WebGraphicsContext3D::Attributes()).PassAs<WebKit::WebGraphicsContext3D>()).PassAs<cc::OutputSurface>();
+ return FakeOutputSurface::Create3d(
+ WebKit::CompositorFakeWebGraphicsContext3D::create(
+ WebKit::WebGraphicsContext3D::Attributes())
+ .PassAs<WebKit::WebGraphicsContext3D>())
+ .PassAs<cc::OutputSurface>();
}
-} // namespace WebKit
+} // namespace cc
#endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_
« no previous file with comments | « cc/test/fake_layer_tree_host_client.cc ('k') | cc/test/fake_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698