Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: content/renderer/gpu/compositor_software_output_device_gl_adapter.h

Issue 11348371: cc: Move WebCompositorOutputSurface and related classes into cc/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mynits Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "third_party/skia/include/core/SkCanvas.h" 14 #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/WebImage.h"
15 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorSoftwa reOutputDevice.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 WebKit::WebCompositorSoftwareOutputDevice), 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 CompositorSoftwareOutputDeviceGLAdapter(
28 WebKit::WebGraphicsContext3D* context3d); 28 WebKit::WebGraphicsContext3D* context3d);
29 virtual ~CompositorSoftwareOutputDeviceGLAdapter(); 29 virtual ~CompositorSoftwareOutputDeviceGLAdapter();
30 30
31 virtual WebKit::WebImage* lock(bool forWrite) OVERRIDE; 31 // cc::SoftwareOutputDevice implementation
32 virtual void unlock() OVERRIDE; 32 virtual WebKit::WebImage* Lock(bool forWrite) OVERRIDE;
33 33 virtual void Unlock() OVERRIDE;
34 virtual void didChangeViewportSize(WebKit::WebSize size) OVERRIDE; 34 virtual void DidChangeViewportSize(gfx::Size size) OVERRIDE;
35 35
36 private: 36 private:
37 void Initialize(); 37 void Initialize();
38 void Destroy(); 38 void Destroy();
39 void Resize(const gfx::Size& viewportSize); 39 void Resize(const gfx::Size& viewportSize);
40 void Draw(void* pixels); 40 void Draw(void* pixels);
41 41
42 bool initialized_; 42 bool initialized_;
43 int program_; 43 int program_;
44 int vertex_shader_; 44 int vertex_shader_;
45 int fragment_shader_; 45 int fragment_shader_;
46 unsigned int vertex_buffer_; 46 unsigned int vertex_buffer_;
47 unsigned framebuffer_texture_id_; 47 unsigned framebuffer_texture_id_;
48 gfx::Size framebuffer_texture_size_; 48 gfx::Size framebuffer_texture_size_;
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698