Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 648 sync_point_client_ = base::MakeUnique<SyncPointClient>( | 648 sync_point_client_ = base::MakeUnique<SyncPointClient>( |
| 649 channel_->sync_point_manager(), | 649 channel_->sync_point_manager(), |
| 650 channel_->GetSyncPointOrderData(stream_id_), | 650 channel_->GetSyncPointOrderData(stream_id_), |
| 651 CommandBufferNamespace::GPU_IO, command_buffer_id_); | 651 CommandBufferNamespace::GPU_IO, command_buffer_id_); |
| 652 | 652 |
| 653 executor_->SetPreemptByFlag(channel_->preempted_flag()); | 653 executor_->SetPreemptByFlag(channel_->preempted_flag()); |
| 654 | 654 |
| 655 decoder_->set_engine(executor_.get()); | 655 decoder_->set_engine(executor_.get()); |
| 656 | 656 |
| 657 if (offscreen) { | 657 if (offscreen) { |
| 658 #if defined(OS_ANDROID) | |
| 659 // This code isn't really platform specific, but apparently NaCl | |
| 660 // plugins on Ozone requested custom attributes for offscreen | |
| 661 // surfaces even though there is no implementation to apply these | |
| 662 // features. For now, continue ignoring the attributes for | |
|
jbauman
2017/03/21 00:51:41
I think what's happening with NaCL is that the GLE
| |
| 663 // backwards compatibility. TODO(klausw,crbug.com/699664): remove | |
| 664 // the Android conditional once it's generally supported, and/or | |
| 665 // add a separate use_own_surface boolean attribute to make this | |
| 666 // explicitly opt-in. | |
| 658 if (init_params.attribs.depth_size > 0) { | 667 if (init_params.attribs.depth_size > 0) { |
| 659 surface_format.SetDepthBits(init_params.attribs.depth_size); | 668 surface_format.SetDepthBits(init_params.attribs.depth_size); |
| 660 } | 669 } |
| 661 if (init_params.attribs.samples > 0) { | 670 if (init_params.attribs.samples > 0) { |
| 662 surface_format.SetSamples(init_params.attribs.samples); | 671 surface_format.SetSamples(init_params.attribs.samples); |
| 663 } | 672 } |
| 664 if (init_params.attribs.stencil_size > 0) { | 673 if (init_params.attribs.stencil_size > 0) { |
| 665 surface_format.SetStencilBits(init_params.attribs.stencil_size); | 674 surface_format.SetStencilBits(init_params.attribs.stencil_size); |
| 666 } | 675 } |
| 676 #endif | |
| 667 // Currently, we can't separately control alpha channel for surfaces, | 677 // Currently, we can't separately control alpha channel for surfaces, |
| 668 // it's generally enabled by default except for RGB565 and (on desktop) | 678 // it's generally enabled by default except for RGB565 and (on desktop) |
| 669 // smaller-than-32bit formats. | 679 // smaller-than-32bit formats. |
| 670 // | 680 // |
| 671 // TODO(klausw): use init_params.attribs.alpha_size here if possible. | 681 // TODO(klausw): use init_params.attribs.alpha_size here if possible. |
| 672 if (!surface_format.IsCompatible(default_surface->GetFormat())) { | 682 if (!surface_format.IsCompatible(default_surface->GetFormat())) { |
| 673 DVLOG(1) << __FUNCTION__ << ": Hit the OwnOffscreenSurface path"; | 683 DVLOG(1) << __FUNCTION__ << ": Hit the OwnOffscreenSurface path"; |
| 674 use_virtualized_gl_context_ = false; | 684 use_virtualized_gl_context_ = false; |
| 675 surface_ = gl::init::CreateOffscreenGLSurfaceWithFormat(gfx::Size(), | 685 surface_ = gl::init::CreateOffscreenGLSurfaceWithFormat(gfx::Size(), |
| 676 surface_format); | 686 surface_format); |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1228 command_buffer_->GetLastState().error == error::kLostContext) | 1238 command_buffer_->GetLastState().error == error::kLostContext) |
| 1229 return; | 1239 return; |
| 1230 | 1240 |
| 1231 command_buffer_->SetContextLostReason(error::kUnknown); | 1241 command_buffer_->SetContextLostReason(error::kUnknown); |
| 1232 if (decoder_) | 1242 if (decoder_) |
| 1233 decoder_->MarkContextLost(error::kUnknown); | 1243 decoder_->MarkContextLost(error::kUnknown); |
| 1234 command_buffer_->SetParseError(error::kLostContext); | 1244 command_buffer_->SetParseError(error::kLostContext); |
| 1235 } | 1245 } |
| 1236 | 1246 |
| 1237 } // namespace gpu | 1247 } // namespace gpu |
| OLD | NEW |