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

Unified Diff: gpu/command_buffer/service/gpu_processor.h

Issue 1136006: Calling OpenGL from the renderer process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gpu_processor.h
===================================================================
--- gpu/command_buffer/service/gpu_processor.h (revision 42644)
+++ gpu/command_buffer/service/gpu_processor.h (working copy)
@@ -9,7 +9,9 @@
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/shared_memory.h"
+#include "base/task.h"
#include "gfx/native_widget_types.h"
+#include "gfx/size.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
#include "gpu/command_buffer/service/cmd_parser.h"
@@ -20,8 +22,7 @@
// This class processes commands in a command buffer. It is event driven and
// posts tasks to the current message loop to do additional work.
-class GPUProcessor : public base::RefCounted<GPUProcessor>,
- public CommandBufferEngine {
+class GPUProcessor : public CommandBufferEngine {
public:
explicit GPUProcessor(CommandBuffer* command_buffer);
@@ -31,7 +32,10 @@
CommandParser* parser,
int commands_per_update);
- virtual bool Initialize(gfx::PluginWindowHandle hwnd);
+ virtual bool Initialize(gfx::PluginWindowHandle hwnd,
+ GPUProcessor* parent,
+ const gfx::Size& size,
+ uint32 parent_texture_id);
virtual ~GPUProcessor();
@@ -45,6 +49,9 @@
virtual bool SetGetOffset(int32 offset);
virtual int32 GetGetOffset();
+ // Asynchronously resizes an offscreen frame buffer.
+ void ResizeOffscreenFrameBuffer(const gfx::Size& size);
+
#if defined(OS_MACOSX)
// Needed only on Mac OS X, which does not render into an on-screen
// window and therefore requires the backing store to be resized
@@ -71,37 +78,15 @@
// through the ProcessCommands callback.
CommandBuffer* command_buffer_;
- scoped_ptr< ::base::SharedMemory> mapped_ring_buffer_;
int commands_per_update_;
gles2::ContextGroup group_;
scoped_ptr<gles2::GLES2Decoder> decoder_;
scoped_ptr<CommandParser> parser_;
+
+ ScopedRunnableMethodFactory<GPUProcessor> method_factory_;
};
} // namespace gpu
-// Callbacks to the GPUProcessor hold a reference count.
-template <typename Method>
-class CallbackStorage<gpu::GPUProcessor, Method> {
- public:
- CallbackStorage(gpu::GPUProcessor* obj, Method method)
- : obj_(obj),
- meth_(method) {
- DCHECK(obj_);
- obj_->AddRef();
- }
-
- ~CallbackStorage() {
- obj_->Release();
- }
-
- protected:
- gpu::GPUProcessor* obj_;
- Method meth_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CallbackStorage);
-};
-
#endif // GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc ('k') | gpu/command_buffer/service/gpu_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698