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

Side by Side Diff: chrome/gpu/gpu_command_buffer_stub.h

Issue 4815001: Use inner HWND for accelerated rendering on windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 1 month 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_GPU_GPU_COMMAND_BUFFER_STUB_H_ 5 #ifndef CHROME_GPU_GPU_COMMAND_BUFFER_STUB_H_
6 #define CHROME_GPU_GPU_COMMAND_BUFFER_STUB_H_ 6 #define CHROME_GPU_GPU_COMMAND_BUFFER_STUB_H_
7 #pragma once 7 #pragma once
8 8
9 #if defined(ENABLE_GPU) 9 #if defined(ENABLE_GPU)
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 virtual void OnMessageReceived(const IPC::Message& message); 44 virtual void OnMessageReceived(const IPC::Message& message);
45 45
46 // IPC::Message::Sender implementation: 46 // IPC::Message::Sender implementation:
47 virtual bool Send(IPC::Message* msg); 47 virtual bool Send(IPC::Message* msg);
48 48
49 // Get the GLContext associated with this object. 49 // Get the GLContext associated with this object.
50 gpu::GPUProcessor* processor() const { return processor_.get(); } 50 gpu::GPUProcessor* processor() const { return processor_.get(); }
51 51
52 int32 route_id() const { return route_id_; } 52 int32 route_id() const { return route_id_; }
53 53
54 #if defined(OS_WIN)
55 public:
apatrick_chromium 2010/11/11 22:32:15 I would be safer to move "public:" out of the prep
nduca 2010/11/11 23:53:33 Done.
56 void OnCompositorWindowPainted();
57 #endif
58
54 private: 59 private:
55 // Message handlers: 60 // Message handlers:
56 void OnInitialize(int32 size, base::SharedMemoryHandle* ring_buffer); 61 void OnInitialize(int32 size, base::SharedMemoryHandle* ring_buffer);
57 void OnGetState(gpu::CommandBuffer::State* state); 62 void OnGetState(gpu::CommandBuffer::State* state);
58 void OnAsyncGetState(); 63 void OnAsyncGetState();
59 void OnFlush(int32 put_offset, gpu::CommandBuffer::State* state); 64 void OnFlush(int32 put_offset, gpu::CommandBuffer::State* state);
60 void OnAsyncFlush(int32 put_offset); 65 void OnAsyncFlush(int32 put_offset);
61 void OnCreateTransferBuffer(int32 size, int32* id); 66 void OnCreateTransferBuffer(int32 size, int32* id);
62 void OnDestroyTransferBuffer(int32 id); 67 void OnDestroyTransferBuffer(int32 id);
63 void OnGetTransferBuffer(int32 id, 68 void OnGetTransferBuffer(int32 id,
64 base::SharedMemoryHandle* transfer_buffer, 69 base::SharedMemoryHandle* transfer_buffer,
65 uint32* size); 70 uint32* size);
66 void OnResizeOffscreenFrameBuffer(const gfx::Size& size); 71 void OnResizeOffscreenFrameBuffer(const gfx::Size& size);
67 72
68 void OnSwapBuffers(); 73 void OnSwapBuffers();
69 74
70 #if defined(OS_MACOSX) 75 #if defined(OS_MACOSX)
71 void OnSetWindowSize(const gfx::Size& size); 76 void OnSetWindowSize(const gfx::Size& size);
72 void SwapBuffersCallback(); 77 void SwapBuffersCallback();
78 #elif defined(OS_WIN)
79 void CreateCompositorWindow();
80 HWND compositor_window_;
apatrick_chromium 2010/11/11 22:32:15 If HWND was gfx::NativeView, would it be easier to
nduca 2010/11/11 23:53:33 The linux version does not create a child window a
73 #endif 81 #endif
74 82
75 // The lifetime of objects of this class is managed by a GpuChannel. The 83 // The lifetime of objects of this class is managed by a GpuChannel. The
76 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they 84 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they
77 // are destroyed. So a raw pointer is safe. 85 // are destroyed. So a raw pointer is safe.
78 GpuChannel* channel_; 86 GpuChannel* channel_;
79 87
80 gfx::PluginWindowHandle handle_; 88 gfx::PluginWindowHandle handle_;
81 base::WeakPtr<GpuCommandBufferStub> parent_; 89 base::WeakPtr<GpuCommandBufferStub> parent_;
82 gfx::Size initial_size_; 90 gfx::Size initial_size_;
83 std::string allowed_extensions_; 91 std::string allowed_extensions_;
84 std::vector<int32> requested_attribs_; 92 std::vector<int32> requested_attribs_;
85 uint32 parent_texture_id_; 93 uint32 parent_texture_id_;
86 int32 route_id_; 94 int32 route_id_;
87 95
88 // The following two fields are used on Mac OS X to identify the window 96 // The following two fields are used on Mac OS X to identify the window
89 // for the rendering results on the browser side. 97 // for the rendering results on the browser side.
90 int32 renderer_id_; 98 int32 renderer_id_;
91 int32 render_view_id_; 99 int32 render_view_id_;
92 100
93 scoped_ptr<gpu::CommandBufferService> command_buffer_; 101 scoped_ptr<gpu::CommandBufferService> command_buffer_;
94 scoped_ptr<gpu::GPUProcessor> processor_; 102 scoped_ptr<gpu::GPUProcessor> processor_;
95 103
96 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); 104 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub);
97 }; 105 };
98 106
99 #endif // ENABLE_GPU 107 #endif // ENABLE_GPU
100 108
101 #endif // CHROME_GPU_GPU_COMMAND_BUFFER_STUB_H_ 109 #endif // CHROME_GPU_GPU_COMMAND_BUFFER_STUB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698