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

Side by Side Diff: gpu/ipc/service/gpu_command_buffer_stub.cc

Issue 2488413003: Mus: ImageTransportSurface should not depend on GpuChannelManager (Closed)
Patch Set: Fix windows compile issue Created 4 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
« no previous file with comments | « gpu/ipc/service/gpu_command_buffer_stub.h ('k') | gpu/ipc/service/image_transport_surface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "gpu/ipc/service/gpu_command_buffer_stub.h" 5 #include "gpu/ipc/service/gpu_command_buffer_stub.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 base::TimeDelta::FromMilliseconds(kHandleMoreWorkPeriodMs)); 269 base::TimeDelta::FromMilliseconds(kHandleMoreWorkPeriodMs));
270 } 270 }
271 271
272 return handled; 272 return handled;
273 } 273 }
274 274
275 bool GpuCommandBufferStub::Send(IPC::Message* message) { 275 bool GpuCommandBufferStub::Send(IPC::Message* message) {
276 return channel_->Send(message); 276 return channel_->Send(message);
277 } 277 }
278 278
279 #if defined(OS_WIN)
280 void GpuCommandBufferStub::DidCreateAcceleratedSurfaceChildWindow(
281 SurfaceHandle parent_window,
282 SurfaceHandle child_window) {
283 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager();
284 gpu_channel_manager->delegate()->SendAcceleratedSurfaceCreatedChildWindow(
285 parent_window, child_window);
286 }
287 #endif
288
279 void GpuCommandBufferStub::DidSwapBuffersComplete( 289 void GpuCommandBufferStub::DidSwapBuffersComplete(
280 SwapBuffersCompleteParams params) { 290 SwapBuffersCompleteParams params) {
281 GpuCommandBufferMsg_SwapBuffersCompleted_Params send_params; 291 GpuCommandBufferMsg_SwapBuffersCompleted_Params send_params;
282 #if defined(OS_MACOSX) 292 #if defined(OS_MACOSX)
283 send_params.ca_context_id = params.ca_context_id; 293 send_params.ca_context_id = params.ca_context_id;
284 send_params.fullscreen_low_power_ca_context_valid = 294 send_params.fullscreen_low_power_ca_context_valid =
285 params.fullscreen_low_power_ca_context_valid; 295 params.fullscreen_low_power_ca_context_valid;
286 send_params.io_surface = params.io_surface; 296 send_params.io_surface = params.io_surface;
287 send_params.pixel_size = params.pixel_size; 297 send_params.pixel_size = params.pixel_size;
288 send_params.scale_factor = params.scale_factor; 298 send_params.scale_factor = params.scale_factor;
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 CommandBufferNamespace::GPU_IO, command_buffer_id_); 560 CommandBufferNamespace::GPU_IO, command_buffer_id_);
551 561
552 executor_->SetPreemptByFlag(channel_->preempted_flag()); 562 executor_->SetPreemptByFlag(channel_->preempted_flag());
553 563
554 decoder_->set_engine(executor_.get()); 564 decoder_->set_engine(executor_.get());
555 565
556 if (offscreen) { 566 if (offscreen) {
557 surface_ = default_surface; 567 surface_ = default_surface;
558 } else { 568 } else {
559 surface_ = ImageTransportSurface::CreateNativeSurface( 569 surface_ = ImageTransportSurface::CreateNativeSurface(
560 manager, AsWeakPtr(), surface_handle_, surface_format); 570 AsWeakPtr(), surface_handle_, surface_format);
561 if (!surface_ || !surface_->Initialize(surface_format)) { 571 if (!surface_ || !surface_->Initialize(surface_format)) {
562 surface_ = nullptr; 572 surface_ = nullptr;
563 DLOG(ERROR) << "Failed to create surface."; 573 DLOG(ERROR) << "Failed to create surface.";
564 return false; 574 return false;
565 } 575 }
566 } 576 }
567 577
568 scoped_refptr<gl::GLContext> context; 578 scoped_refptr<gl::GLContext> context;
569 gl::GLShareGroup* gl_share_group = channel_->share_group(); 579 gl::GLShareGroup* gl_share_group = channel_->share_group();
570 if (use_virtualized_gl_context_ && gl_share_group) { 580 if (use_virtualized_gl_context_ && gl_share_group) {
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 command_buffer_->GetLastState().error == error::kLostContext) 1142 command_buffer_->GetLastState().error == error::kLostContext)
1133 return; 1143 return;
1134 1144
1135 command_buffer_->SetContextLostReason(error::kUnknown); 1145 command_buffer_->SetContextLostReason(error::kUnknown);
1136 if (decoder_) 1146 if (decoder_)
1137 decoder_->MarkContextLost(error::kUnknown); 1147 decoder_->MarkContextLost(error::kUnknown);
1138 command_buffer_->SetParseError(error::kLostContext); 1148 command_buffer_->SetParseError(error::kLostContext);
1139 } 1149 }
1140 1150
1141 } // namespace gpu 1151 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_command_buffer_stub.h ('k') | gpu/ipc/service/image_transport_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698