OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_SOFTWARE_GL_ADAPTER_H_ | |
6 #define CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_SOFTWARE_GL_ADAPTER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/memory/ref_counted.h" | |
12 #include "base/threading/non_thread_safe.h" | |
13 #include "third_party/skia/include/core/SkCanvas.h" | |
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebImage.h" | |
15 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput SurfaceSoftware.h" | |
16 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" | |
17 #include "ui/gfx/size.h" | |
18 | |
19 // This class can be created only on the main thread, but then becomes pinned | |
20 // to a fixed thread when bindToClient is called. | |
21 class CompositorOutputSurfaceSoftwareGLAdapter | |
22 : NON_EXPORTED_BASE(public WebKit::WebCompositorOutputSurfaceSoftware) | |
23 , NON_EXPORTED_BASE(public base::NonThreadSafe) { | |
piman
2012/08/28 23:26:59
nit: style for base classes (comma goes to previou
| |
24 public: | |
25 CompositorOutputSurfaceSoftwareGLAdapter( | |
26 WebKit::WebGraphicsContext3D* context3d); | |
27 virtual ~CompositorOutputSurfaceSoftwareGLAdapter(); | |
28 | |
29 virtual WebKit::WebImage* lock() OVERRIDE; | |
30 virtual void unlockAndOutputFrame() OVERRIDE; | |
31 | |
32 virtual void viewportChanged(const WebKit::WebSize& size) OVERRIDE; | |
33 | |
34 private: | |
35 void Initialize(); | |
36 void Destroy(); | |
37 void Resize(const gfx::Size& viewportSize); | |
38 void Draw(void* pixels); | |
39 | |
40 bool initialized_; | |
41 int program_; | |
42 int vertex_shader_; | |
43 int fragment_shader_; | |
44 unsigned int vertex_buffer_; | |
45 unsigned framebuffer_texture_id_; | |
46 gfx::Size framebufferTextureSize_; | |
piman
2012/08/28 23:26:59
nit: framebuffer_texture_size_
| |
47 | |
48 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; | |
49 scoped_ptr<SkDevice> device_; | |
50 WebKit::WebImage image_; | |
51 }; | |
52 | |
53 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_SOFTWARE_GL_ADAPTER_H_ | |
OLD | NEW |