OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_GL_ADAPTER_H_ | 5 #ifndef CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_GL_ADAPTER_H_ |
6 #define CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_GL_ADAPTER_H_ | 6 #define CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_GL_ADAPTER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
13 #include "cc/software_output_device.h" | 13 #include "cc/software_output_device.h" |
14 #include "third_party/skia/include/core/SkCanvas.h" | 14 #include "third_party/skia/include/core/SkCanvas.h" |
15 #include "third_party/WebKit/Source/Platform/chromium/public/WebImage.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebImage.h" |
16 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
17 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 // This class can be created only on the main thread, but then becomes pinned | 21 // This class can be created only on the main thread, but then becomes pinned |
22 // to a fixed thread when bindToClient is called. | 22 // to a fixed thread when bindToClient is called. |
23 class CompositorSoftwareOutputDeviceGLAdapter | 23 class CompositorSoftwareOutputDeviceGLAdapter |
24 : NON_EXPORTED_BASE(public cc::SoftwareOutputDevice), | 24 : NON_EXPORTED_BASE(public cc::SoftwareOutputDevice), |
25 NON_EXPORTED_BASE(public base::NonThreadSafe) { | 25 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
26 public: | 26 public: |
27 CompositorSoftwareOutputDeviceGLAdapter( | 27 explicit CompositorSoftwareOutputDeviceGLAdapter( |
28 WebKit::WebGraphicsContext3D* context3d); | 28 WebKit::WebGraphicsContext3D* context3d); |
29 virtual ~CompositorSoftwareOutputDeviceGLAdapter(); | 29 virtual ~CompositorSoftwareOutputDeviceGLAdapter(); |
30 | 30 |
31 // cc::SoftwareOutputDevice implementation | 31 // cc::SoftwareOutputDevice implementation |
32 virtual WebKit::WebImage* Lock(bool forWrite) OVERRIDE; | 32 virtual WebKit::WebImage* Lock(bool forWrite) OVERRIDE; |
33 virtual void Unlock() OVERRIDE; | 33 virtual void Unlock() OVERRIDE; |
34 virtual void DidChangeViewportSize(gfx::Size size) OVERRIDE; | 34 virtual void DidChangeViewportSize(gfx::Size size) OVERRIDE; |
35 | 35 |
36 private: | 36 private: |
37 void Initialize(); | 37 void Initialize(); |
(...skipping 11 matching lines...) Loading... |
49 | 49 |
50 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; | 50 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; |
51 scoped_ptr<SkDevice> device_; | 51 scoped_ptr<SkDevice> device_; |
52 WebKit::WebImage image_; | 52 WebKit::WebImage image_; |
53 bool locked_for_write_; | 53 bool locked_for_write_; |
54 }; | 54 }; |
55 | 55 |
56 } // namespace content | 56 } // namespace content |
57 | 57 |
58 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_GL_ADAPTER_H_ | 58 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_GL_ADAPTER_H_ |
OLD | NEW |