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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.h

Issue 6883179: Rework FlushSync to return early if commands have been processed since the last update (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup, fix tests Created 9 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 5 #ifndef CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 6 #define CONTENT_COMMON_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
11 #include <vector> 11 #include <vector>
12 #include <string> 12 #include <string>
13 13
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/process.h" 15 #include "base/process.h"
16 #include "base/task.h"
16 #include "gpu/command_buffer/service/command_buffer_service.h" 17 #include "gpu/command_buffer/service/command_buffer_service.h"
17 #include "gpu/command_buffer/service/gpu_scheduler.h" 18 #include "gpu/command_buffer/service/gpu_scheduler.h"
18 #include "ipc/ipc_channel.h" 19 #include "ipc/ipc_channel.h"
19 #include "ipc/ipc_message.h" 20 #include "ipc/ipc_message.h"
20 #include "ui/gfx/native_widget_types.h" 21 #include "ui/gfx/native_widget_types.h"
21 #include "ui/gfx/size.h" 22 #include "ui/gfx/size.h"
22 23
23 class GpuChannel; 24 class GpuChannel;
24 class GpuWatchdog; 25 class GpuWatchdog;
25 26
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 void AcceleratedSurfaceBuffersSwapped(uint64 swap_buffers_count); 74 void AcceleratedSurfaceBuffersSwapped(uint64 swap_buffers_count);
74 #endif // defined(OS_MACOSX) 75 #endif // defined(OS_MACOSX)
75 76
76 private: 77 private:
77 // Message handlers: 78 // Message handlers:
78 void OnInitialize(base::SharedMemoryHandle ring_buffer, 79 void OnInitialize(base::SharedMemoryHandle ring_buffer,
79 int32 size, 80 int32 size,
80 bool* result); 81 bool* result);
81 void OnGetState(gpu::CommandBuffer::State* state); 82 void OnGetState(gpu::CommandBuffer::State* state);
82 void OnAsyncGetState(); 83 void OnAsyncGetState();
83 void OnFlush(int32 put_offset, gpu::CommandBuffer::State* state); 84 void OnFlush(int32 put_offset,
85 int32 last_known_get,
86 gpu::CommandBuffer::State* state);
84 void OnAsyncFlush(int32 put_offset); 87 void OnAsyncFlush(int32 put_offset);
85 void OnCreateTransferBuffer(int32 size, int32 id_request, int32* id); 88 void OnCreateTransferBuffer(int32 size, int32 id_request, int32* id);
86 void OnRegisterTransferBuffer(base::SharedMemoryHandle transfer_buffer, 89 void OnRegisterTransferBuffer(base::SharedMemoryHandle transfer_buffer,
87 size_t size, 90 size_t size,
88 int32 id_request, 91 int32 id_request,
89 int32* id); 92 int32* id);
90 void OnDestroyTransferBuffer(int32 id); 93 void OnDestroyTransferBuffer(int32 id);
91 void OnGetTransferBuffer(int32 id, 94 void OnGetTransferBuffer(int32 id,
92 base::SharedMemoryHandle* transfer_buffer, 95 base::SharedMemoryHandle* transfer_buffer,
93 uint32* size); 96 uint32* size);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 #endif // defined(OS_WIN) 129 #endif // defined(OS_WIN)
127 130
128 // The following two fields are used on Mac OS X to identify the window 131 // The following two fields are used on Mac OS X to identify the window
129 // for the rendering results on the browser side. 132 // for the rendering results on the browser side.
130 int32 renderer_id_; 133 int32 renderer_id_;
131 int32 render_view_id_; 134 int32 render_view_id_;
132 135
133 scoped_ptr<gpu::CommandBufferService> command_buffer_; 136 scoped_ptr<gpu::CommandBufferService> command_buffer_;
134 scoped_ptr<gpu::GpuScheduler> scheduler_; 137 scoped_ptr<gpu::GpuScheduler> scheduler_;
135 GpuWatchdog* watchdog_; 138 GpuWatchdog* watchdog_;
139 ScopedRunnableMethodFactory<GpuCommandBufferStub> task_factory_;
136 140
137 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); 141 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub);
138 }; 142 };
139 143
140 #endif // defined(ENABLE_GPU) 144 #endif // defined(ENABLE_GPU)
141 145
142 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 146 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | content/common/gpu/gpu_command_buffer_stub.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698