summaryrefslogtreecommitdiffstats
path: root/chrome/gpu
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-05 18:11:39 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-05 18:11:39 +0000
commit8e5cc282d45e58103b7e67c510c1ca09662b6e29 (patch)
tree098f2aa297ffbbf72cbc9b7e6ff5f96ee49dcb6b /chrome/gpu
parent8403940eafd65042f05c3dd0c51a103d97139571 (diff)
downloadchromium_src-8e5cc282d45e58103b7e67c510c1ca09662b6e29.zip
chromium_src-8e5cc282d45e58103b7e67c510c1ca09662b6e29.tar.gz
chromium_src-8e5cc282d45e58103b7e67c510c1ca09662b6e29.tar.bz2
Coverity: Initialize member variables.
Also fix up some style issues. CID=13912,13971,13977 BUG=none TEST=none Review URL: http://codereview.chromium.org/5618002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68313 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/gpu')
-rw-r--r--chrome/gpu/gpu_command_buffer_stub.cc19
-rw-r--r--chrome/gpu/gpu_command_buffer_stub.h17
2 files changed, 22 insertions, 14 deletions
diff --git a/chrome/gpu/gpu_command_buffer_stub.cc b/chrome/gpu/gpu_command_buffer_stub.cc
index ba26f23..f11308d 100644
--- a/chrome/gpu/gpu_command_buffer_stub.cc
+++ b/chrome/gpu/gpu_command_buffer_stub.cc
@@ -16,7 +16,7 @@ using gpu::Buffer;
#if defined(OS_WIN)
#define kCompositorWindowOwner L"CompositorWindowOwner"
-#endif
+#endif // defined(OS_WIN)
GpuCommandBufferStub::GpuCommandBufferStub(
GpuChannel* channel,
@@ -38,6 +38,9 @@ GpuCommandBufferStub::GpuCommandBufferStub(
requested_attribs_(attribs),
parent_texture_id_(parent_texture_id),
route_id_(route_id),
+#if defined(OS_WIN)
+ compositor_window_(NULL),
+#endif // defined(OS_WIN)
renderer_id_(renderer_id),
render_view_id_(render_view_id) {
}
@@ -163,7 +166,7 @@ GpuCommandBufferStub::~GpuCommandBufferStub() {
ChildThread* gpu_thread = ChildThread::current();
gpu_thread->Send(
new GpuHostMsg_ReleaseXID(handle_));
-#endif
+#endif // defined(OS_WIN)
}
void GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
@@ -183,7 +186,7 @@ void GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
OnResizeOffscreenFrameBuffer);
#if defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SetWindowSize, OnSetWindowSize);
-#endif
+#endif // defined(OS_MACOSX)
IPC_MESSAGE_UNHANDLED_ERROR()
IPC_END_MESSAGE_MAP()
}
@@ -214,7 +217,7 @@ void GpuCommandBufferStub::OnInitialize(
}
#else
gfx::PluginWindowHandle output_window_handle = handle_;
-#endif
+#endif // defined(OS_WIN)
// Initialize the CommandBufferService and GPUProcessor.
if (command_buffer_->Initialize(size)) {
@@ -258,7 +261,7 @@ void GpuCommandBufferStub::OnInitialize(
NewCallback(this,
&GpuCommandBufferStub::ResizeCallback));
}
-#endif
+#endif // defined(OS_MACOSX)
} else {
processor_.reset();
command_buffer_.reset();
@@ -352,7 +355,7 @@ void GpuCommandBufferStub::SwapBuffersCallback() {
params.route_id = route_id();
#if defined(OS_MACOSX)
params.swap_buffers_count = processor_->swap_buffers_count();
-#endif
+#endif // defined(OS_MACOSX)
gpu_thread->Send(new GpuHostMsg_AcceleratedSurfaceBuffersSwapped(params));
}
@@ -378,7 +381,7 @@ void GpuCommandBufferStub::ResizeCallback(gfx::Size size) {
UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS |
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE;
SetWindowPos(hwnd, NULL, 0, 0, size.width(), size.height(), swp_flags);
-#endif
+#endif // defined(OS_LINUX)
}
-#endif // ENABLE_GPU
+#endif // defined(ENABLE_GPU)
diff --git a/chrome/gpu/gpu_command_buffer_stub.h b/chrome/gpu/gpu_command_buffer_stub.h
index 6d888aa..e61bdd0 100644
--- a/chrome/gpu/gpu_command_buffer_stub.h
+++ b/chrome/gpu/gpu_command_buffer_stub.h
@@ -54,12 +54,12 @@ class GpuCommandBufferStub
#if defined(OS_WIN)
// Called only by the compositor window's window proc
void OnCompositorWindowPainted();
-#endif
+#endif // defined(OS_WIN)
#if defined(OS_MACOSX)
// Called only by the GpuChannel.
void AcceleratedSurfaceBuffersSwapped(uint64 swap_buffers_count);
-#endif
+#endif // defined(OS_MACOSX)
private:
// Message handlers:
@@ -80,10 +80,11 @@ class GpuCommandBufferStub
#if defined(OS_MACOSX)
void OnSetWindowSize(const gfx::Size& size);
void SwapBuffersCallback();
-#elif defined(OS_WIN)
+#endif // defined(OS_MACOSX)
+
+#if defined(OS_WIN)
bool CreateCompositorWindow();
- HWND compositor_window_;
-#endif
+#endif // defined(OS_WIN)
void ResizeCallback(gfx::Size size);
@@ -100,6 +101,10 @@ class GpuCommandBufferStub
uint32 parent_texture_id_;
int32 route_id_;
+#if defined(OS_WIN)
+ HWND compositor_window_;
+#endif // defined(OS_WIN)
+
// The following two fields are used on Mac OS X to identify the window
// for the rendering results on the browser side.
int32 renderer_id_;
@@ -111,6 +116,6 @@ class GpuCommandBufferStub
DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub);
};
-#endif // ENABLE_GPU
+#endif // defined(ENABLE_GPU)
#endif // CHROME_GPU_GPU_COMMAND_BUFFER_STUB_H_