OLD | NEW |
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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 OnInitializeFailed(reply_message); | 186 OnInitializeFailed(reply_message); |
187 return; | 187 return; |
188 } | 188 } |
189 | 189 |
190 surface_ = ImageTransportSurface::CreateSurface( | 190 surface_ = ImageTransportSurface::CreateSurface( |
191 channel_->gpu_channel_manager(), | 191 channel_->gpu_channel_manager(), |
192 render_view_id_, | 192 render_view_id_, |
193 renderer_id_, | 193 renderer_id_, |
194 route_id_, | 194 route_id_, |
195 handle_); | 195 handle_); |
196 #elif defined(OS_WIN) || defined(OS_LINUX) | 196 #elif defined(OS_WIN) || defined(OS_LINUX) || defined(OS_OPENBSD) |
197 surface_ = gfx::GLSurface::CreateViewGLSurface(software_, handle_); | 197 surface_ = gfx::GLSurface::CreateViewGLSurface(software_, handle_); |
198 #endif | 198 #endif |
199 } else { | 199 } else { |
200 surface_ = gfx::GLSurface::CreateOffscreenGLSurface(software_, | 200 surface_ = gfx::GLSurface::CreateOffscreenGLSurface(software_, |
201 gfx::Size(1, 1)); | 201 gfx::Size(1, 1)); |
202 } | 202 } |
203 | 203 |
204 if (!surface_.get()) { | 204 if (!surface_.get()) { |
205 // Ensure the decoder is not destroyed if it is not initialized. | 205 // Ensure the decoder is not destroyed if it is not initialized. |
206 decoder_.reset(); | 206 decoder_.reset(); |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 void GpuCommandBufferStub::OnDestroyVideoDecoder(int decoder_route_id) { | 513 void GpuCommandBufferStub::OnDestroyVideoDecoder(int decoder_route_id) { |
514 channel_->RemoveRoute(decoder_route_id); | 514 channel_->RemoveRoute(decoder_route_id); |
515 video_decoders_.Remove(decoder_route_id); | 515 video_decoders_.Remove(decoder_route_id); |
516 } | 516 } |
517 | 517 |
518 void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) { | 518 void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) { |
519 surface_->SetVisible(visible); | 519 surface_->SetVisible(visible); |
520 } | 520 } |
521 | 521 |
522 #endif // defined(ENABLE_GPU) | 522 #endif // defined(ENABLE_GPU) |
OLD | NEW |