Index: content/renderer/gpu/compositor_output_surface_software_gl_adapter.h |
diff --git a/content/renderer/gpu/compositor_output_surface_software_gl_adapter.h b/content/renderer/gpu/compositor_output_surface_software_gl_adapter.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2c450939d86efd2ef363c2af0143376f28b6fd9e |
--- /dev/null |
+++ b/content/renderer/gpu/compositor_output_surface_software_gl_adapter.h |
@@ -0,0 +1,53 @@ |
+// Copyright (c) 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 CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_SOFTWARE_GL_ADAPTER_H_ |
+#define CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_SOFTWARE_GL_ADAPTER_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/compiler_specific.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "base/memory/ref_counted.h" |
+#include "base/threading/non_thread_safe.h" |
+#include "third_party/skia/include/core/SkCanvas.h" |
+#include "third_party/WebKit/Source/Platform/chromium/public/WebImage.h" |
+#include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutputSurfaceSoftware.h" |
+#include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h" |
+#include "ui/gfx/size.h" |
+ |
+// This class can be created only on the main thread, but then becomes pinned |
+// to a fixed thread when bindToClient is called. |
+class CompositorOutputSurfaceSoftwareGLAdapter |
+ : NON_EXPORTED_BASE(public WebKit::WebCompositorOutputSurfaceSoftware) |
+ , NON_EXPORTED_BASE(public base::NonThreadSafe) { |
piman
2012/08/28 23:26:59
nit: style for base classes (comma goes to previou
|
+public: |
+ CompositorOutputSurfaceSoftwareGLAdapter( |
+ WebKit::WebGraphicsContext3D* context3d); |
+ virtual ~CompositorOutputSurfaceSoftwareGLAdapter(); |
+ |
+ virtual WebKit::WebImage* lock() OVERRIDE; |
+ virtual void unlockAndOutputFrame() OVERRIDE; |
+ |
+ virtual void viewportChanged(const WebKit::WebSize& size) OVERRIDE; |
+ |
+private: |
+ void Initialize(); |
+ void Destroy(); |
+ void Resize(const gfx::Size& viewportSize); |
+ void Draw(void* pixels); |
+ |
+ bool initialized_; |
+ int program_; |
+ int vertex_shader_; |
+ int fragment_shader_; |
+ unsigned int vertex_buffer_; |
+ unsigned framebuffer_texture_id_; |
+ gfx::Size framebufferTextureSize_; |
piman
2012/08/28 23:26:59
nit: framebuffer_texture_size_
|
+ |
+ scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; |
+ scoped_ptr<SkDevice> device_; |
+ WebKit::WebImage image_; |
+}; |
+ |
+#endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_SOFTWARE_GL_ADAPTER_H_ |