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 |