OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef FakeWebCompositorOutputSurface_h | 5 #ifndef FakeWebCompositorOutputSurface_h |
6 #define FakeWebCompositorOutputSurface_h | 6 #define FakeWebCompositorOutputSurface_h |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "FakeWebCompositorSoftwareOutputDevice.h" | 9 #include "FakeWebCompositorSoftwareOutputDevice.h" |
10 #include <public/WebCompositorOutputSurface.h> | 10 #include <public/WebCompositorOutputSurface.h> |
11 #include <public/WebGraphicsContext3D.h> | 11 #include <public/WebGraphicsContext3D.h> |
12 #include <wtf/OwnPtr.h> | 12 #include <wtf/OwnPtr.h> |
13 #include <wtf/PassOwnPtr.h> | 13 #include <wtf/PassOwnPtr.h> |
14 | 14 |
15 namespace WebKit { | 15 namespace WebKit { |
16 | 16 |
17 class FakeWebCompositorOutputSurface : public WebCompositorOutputSurface { | 17 class FakeWebCompositorOutputSurface : public WebCompositorOutputSurface { |
18 public: | 18 public: |
19 static inline scoped_ptr<FakeWebCompositorOutputSurface> create(PassOwnPtr<W
ebGraphicsContext3D> context3D) | 19 static inline scoped_ptr<FakeWebCompositorOutputSurface> create(PassOwnPtr<W
ebGraphicsContext3D> context3D) |
20 { | 20 { |
21 return scoped_ptr<FakeWebCompositorOutputSurface>(new FakeWebCompositorO
utputSurface(context3D)); | 21 return make_scoped_ptr(new FakeWebCompositorOutputSurface(context3D)); |
22 } | 22 } |
23 | 23 |
24 static inline scoped_ptr<FakeWebCompositorOutputSurface> createSoftware(Pass
OwnPtr<WebCompositorSoftwareOutputDevice> softwareDevice) | 24 static inline scoped_ptr<FakeWebCompositorOutputSurface> createSoftware(Pass
OwnPtr<WebCompositorSoftwareOutputDevice> softwareDevice) |
25 { | 25 { |
26 return scoped_ptr<FakeWebCompositorOutputSurface>(new FakeWebCompositorO
utputSurface(softwareDevice)); | 26 return make_scoped_ptr(new FakeWebCompositorOutputSurface(softwareDevice
)); |
27 } | 27 } |
28 | 28 |
29 virtual bool bindToClient(WebCompositorOutputSurfaceClient* client) OVERRIDE | 29 virtual bool bindToClient(WebCompositorOutputSurfaceClient* client) OVERRIDE |
30 { | 30 { |
31 if (!m_context3D) | 31 if (!m_context3D) |
32 return true; | 32 return true; |
33 ASSERT(client); | 33 ASSERT(client); |
34 if (!m_context3D->makeContextCurrent()) | 34 if (!m_context3D->makeContextCurrent()) |
35 return false; | 35 return false; |
36 m_client = client; | 36 m_client = client; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 OwnPtr<WebGraphicsContext3D> m_context3D; | 69 OwnPtr<WebGraphicsContext3D> m_context3D; |
70 OwnPtr<WebCompositorSoftwareOutputDevice> m_softwareDevice; | 70 OwnPtr<WebCompositorSoftwareOutputDevice> m_softwareDevice; |
71 Capabilities m_capabilities; | 71 Capabilities m_capabilities; |
72 WebCompositorOutputSurfaceClient* m_client; | 72 WebCompositorOutputSurfaceClient* m_client; |
73 }; | 73 }; |
74 | 74 |
75 } // namespace WebKit | 75 } // namespace WebKit |
76 | 76 |
77 #endif // FakeWebCompositorOutputSurface_h | 77 #endif // FakeWebCompositorOutputSurface_h |
OLD | NEW |