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/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 8467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8478 } | 8478 } |
8479 bool is_tracing; | 8479 bool is_tracing; |
8480 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), | 8480 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), |
8481 &is_tracing); | 8481 &is_tracing); |
8482 if (is_tracing) { | 8482 if (is_tracing) { |
8483 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); | 8483 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); |
8484 ScopedFrameBufferBinder binder(this, GetBackbufferServiceId()); | 8484 ScopedFrameBufferBinder binder(this, GetBackbufferServiceId()); |
8485 gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer( | 8485 gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer( |
8486 is_offscreen ? offscreen_size_ : surface_->GetSize()); | 8486 is_offscreen ? offscreen_size_ : surface_->GetSize()); |
8487 } | 8487 } |
8488 if (surface_->PostSubBuffer(c.x, c.y, c.width, c.height)) { | 8488 if (surface_->PostSubBuffer(c.x, c.y, c.width, c.height) != |
| 8489 gfx::SwapResult::SWAP_FAILED) { |
8489 return error::kNoError; | 8490 return error::kNoError; |
8490 } else { | 8491 } else { |
8491 LOG(ERROR) << "Context lost because PostSubBuffer failed."; | 8492 LOG(ERROR) << "Context lost because PostSubBuffer failed."; |
8492 return error::kLostContext; | 8493 return error::kLostContext; |
8493 } | 8494 } |
8494 } | 8495 } |
8495 | 8496 |
8496 error::Error GLES2DecoderImpl::HandleScheduleOverlayPlaneCHROMIUM( | 8497 error::Error GLES2DecoderImpl::HandleScheduleOverlayPlaneCHROMIUM( |
8497 uint32 immediate_data_size, | 8498 uint32 immediate_data_size, |
8498 const void* cmd_data) { | 8499 const void* cmd_data) { |
(...skipping 2512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11011 offscreen_target_color_texture_.get()); | 11012 offscreen_target_color_texture_.get()); |
11012 } | 11013 } |
11013 | 11014 |
11014 // Ensure the side effects of the copy are visible to the parent | 11015 // Ensure the side effects of the copy are visible to the parent |
11015 // context. There is no need to do this for ANGLE because it uses a | 11016 // context. There is no need to do this for ANGLE because it uses a |
11016 // single D3D device for all contexts. | 11017 // single D3D device for all contexts. |
11017 if (!feature_info_->gl_version_info().is_angle) | 11018 if (!feature_info_->gl_version_info().is_angle) |
11018 glFlush(); | 11019 glFlush(); |
11019 } | 11020 } |
11020 } else { | 11021 } else { |
11021 if (!surface_->SwapBuffers()) { | 11022 if (surface_->SwapBuffers() == gfx::SwapResult::SWAP_FAILED) { |
11022 LOG(ERROR) << "Context lost because SwapBuffers failed."; | 11023 LOG(ERROR) << "Context lost because SwapBuffers failed."; |
11023 if (!CheckResetStatus()) { | 11024 if (!CheckResetStatus()) { |
11024 MarkContextLost(error::kUnknown); | 11025 MarkContextLost(error::kUnknown); |
11025 group_->LoseContexts(error::kUnknown); | 11026 group_->LoseContexts(error::kUnknown); |
11026 } | 11027 } |
11027 } | 11028 } |
11028 } | 11029 } |
11029 | 11030 |
11030 // This may be a slow command. Exit command processing to allow for | 11031 // This may be a slow command. Exit command processing to allow for |
11031 // context preemption and GPU watchdog checks. | 11032 // context preemption and GPU watchdog checks. |
(...skipping 2277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13309 } | 13310 } |
13310 } | 13311 } |
13311 | 13312 |
13312 // Include the auto-generated part of this file. We split this because it means | 13313 // Include the auto-generated part of this file. We split this because it means |
13313 // we can easily edit the non-auto generated parts right here in this file | 13314 // we can easily edit the non-auto generated parts right here in this file |
13314 // instead of having to edit some template or the code generator. | 13315 // instead of having to edit some template or the code generator. |
13315 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 13316 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
13316 | 13317 |
13317 } // namespace gles2 | 13318 } // namespace gles2 |
13318 } // namespace gpu | 13319 } // namespace gpu |
OLD | NEW |