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