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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 1084173004: Adding status to swap complete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: copy/paste error Created 5 years, 7 months 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
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/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 8205 matching lines...) Expand 10 before | Expand all | Expand 10 after
8216 } 8216 }
8217 bool is_tracing; 8217 bool is_tracing;
8218 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), 8218 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"),
8219 &is_tracing); 8219 &is_tracing);
8220 if (is_tracing) { 8220 if (is_tracing) {
8221 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); 8221 bool is_offscreen = !!offscreen_target_frame_buffer_.get();
8222 ScopedFrameBufferBinder binder(this, GetBackbufferServiceId()); 8222 ScopedFrameBufferBinder binder(this, GetBackbufferServiceId());
8223 gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer( 8223 gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer(
8224 is_offscreen ? offscreen_size_ : surface_->GetSize()); 8224 is_offscreen ? offscreen_size_ : surface_->GetSize());
8225 } 8225 }
8226 if (surface_->PostSubBuffer(c.x, c.y, c.width, c.height)) { 8226 if (surface_->PostSubBuffer(c.x, c.y, c.width, c.height) !=
8227 gfx::SwapResult::SWAP_FAILED) {
8227 return error::kNoError; 8228 return error::kNoError;
8228 } else { 8229 } else {
8229 LOG(ERROR) << "Context lost because PostSubBuffer failed."; 8230 LOG(ERROR) << "Context lost because PostSubBuffer failed.";
8230 return error::kLostContext; 8231 return error::kLostContext;
8231 } 8232 }
8232 } 8233 }
8233 8234
8234 error::Error GLES2DecoderImpl::HandleScheduleOverlayPlaneCHROMIUM( 8235 error::Error GLES2DecoderImpl::HandleScheduleOverlayPlaneCHROMIUM(
8235 uint32 immediate_data_size, 8236 uint32 immediate_data_size,
8236 const void* cmd_data) { 8237 const void* cmd_data) {
(...skipping 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after
10353 offscreen_target_color_texture_.get()); 10354 offscreen_target_color_texture_.get());
10354 } 10355 }
10355 10356
10356 // Ensure the side effects of the copy are visible to the parent 10357 // Ensure the side effects of the copy are visible to the parent
10357 // context. There is no need to do this for ANGLE because it uses a 10358 // context. There is no need to do this for ANGLE because it uses a
10358 // single D3D device for all contexts. 10359 // single D3D device for all contexts.
10359 if (!feature_info_->gl_version_info().is_angle) 10360 if (!feature_info_->gl_version_info().is_angle)
10360 glFlush(); 10361 glFlush();
10361 } 10362 }
10362 } else { 10363 } else {
10363 if (!surface_->SwapBuffers()) { 10364 if (surface_->SwapBuffers() == gfx::SwapResult::SWAP_FAILED) {
10364 LOG(ERROR) << "Context lost because SwapBuffers failed."; 10365 LOG(ERROR) << "Context lost because SwapBuffers failed.";
10365 LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); 10366 LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB);
10366 } 10367 }
10367 } 10368 }
10368 10369
10369 // This may be a slow command. Exit command processing to allow for 10370 // This may be a slow command. Exit command processing to allow for
10370 // context preemption and GPU watchdog checks. 10371 // context preemption and GPU watchdog checks.
10371 ExitCommandProcessingEarly(); 10372 ExitCommandProcessingEarly();
10372 } 10373 }
10373 10374
(...skipping 2247 matching lines...) Expand 10 before | Expand all | Expand 10 after
12621 } 12622 }
12622 } 12623 }
12623 12624
12624 // Include the auto-generated part of this file. We split this because it means 12625 // Include the auto-generated part of this file. We split this because it means
12625 // we can easily edit the non-auto generated parts right here in this file 12626 // we can easily edit the non-auto generated parts right here in this file
12626 // instead of having to edit some template or the code generator. 12627 // instead of having to edit some template or the code generator.
12627 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 12628 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
12628 12629
12629 } // namespace gles2 12630 } // namespace gles2
12630 } // namespace gpu 12631 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698