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

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

Issue 240073008: Add a gpu.SwapBuffers synthetic delay to PostSubBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename gpu.SwapBuffers to gpu.PresentingFrame Created 6 years, 8 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
« no previous file with comments | « base/debug/trace_event_impl.h ('k') | tools/perf/measurements/smoothness_unittest.py » ('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/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 <list> 10 #include <list>
(...skipping 7529 matching lines...) Expand 10 before | Expand all | Expand 10 after
7540 // Validation should have prevented us from getting here. 7540 // Validation should have prevented us from getting here.
7541 NOTREACHED(); 7541 NOTREACHED();
7542 break; 7542 break;
7543 } 7543 }
7544 return error::kNoError; 7544 return error::kNoError;
7545 } 7545 }
7546 7546
7547 error::Error GLES2DecoderImpl::HandlePostSubBufferCHROMIUM( 7547 error::Error GLES2DecoderImpl::HandlePostSubBufferCHROMIUM(
7548 uint32 immediate_data_size, const cmds::PostSubBufferCHROMIUM& c) { 7548 uint32 immediate_data_size, const cmds::PostSubBufferCHROMIUM& c) {
7549 TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandlePostSubBufferCHROMIUM"); 7549 TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandlePostSubBufferCHROMIUM");
7550 {
7551 TRACE_EVENT_SYNTHETIC_DELAY("gpu.PresentingFrame");
7552 }
7550 if (!supports_post_sub_buffer_) { 7553 if (!supports_post_sub_buffer_) {
7551 LOCAL_SET_GL_ERROR( 7554 LOCAL_SET_GL_ERROR(
7552 GL_INVALID_OPERATION, 7555 GL_INVALID_OPERATION,
7553 "glPostSubBufferCHROMIUM", "command not supported by surface"); 7556 "glPostSubBufferCHROMIUM", "command not supported by surface");
7554 return error::kNoError; 7557 return error::kNoError;
7555 } 7558 }
7556 bool is_tracing; 7559 bool is_tracing;
7557 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), 7560 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"),
7558 &is_tracing); 7561 &is_tracing);
7559 if (is_tracing) { 7562 if (is_tracing) {
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
9048 // TRACE_EVENT for gpu tests: 9051 // TRACE_EVENT for gpu tests:
9049 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffersLatency", 9052 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffersLatency",
9050 TRACE_EVENT_SCOPE_THREAD, 9053 TRACE_EVENT_SCOPE_THREAD,
9051 "GLImpl", static_cast<int>(gfx::GetGLImplementation()), 9054 "GLImpl", static_cast<int>(gfx::GetGLImplementation()),
9052 "width", (is_offscreen ? offscreen_size_.width() : 9055 "width", (is_offscreen ? offscreen_size_.width() :
9053 surface_->GetSize().width())); 9056 surface_->GetSize().width()));
9054 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoSwapBuffers", 9057 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoSwapBuffers",
9055 "offscreen", is_offscreen, 9058 "offscreen", is_offscreen,
9056 "frame", this_frame_number); 9059 "frame", this_frame_number);
9057 { 9060 {
9058 TRACE_EVENT_SYNTHETIC_DELAY("gpu.SwapBuffers"); 9061 TRACE_EVENT_SYNTHETIC_DELAY("gpu.PresentingFrame");
9059 } 9062 }
9060 9063
9061 bool is_tracing; 9064 bool is_tracing;
9062 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), 9065 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"),
9063 &is_tracing); 9066 &is_tracing);
9064 if (is_tracing) { 9067 if (is_tracing) {
9065 ScopedFrameBufferBinder binder(this, GetBackbufferServiceId()); 9068 ScopedFrameBufferBinder binder(this, GetBackbufferServiceId());
9066 gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer( 9069 gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer(
9067 is_offscreen ? offscreen_size_ : surface_->GetSize()); 9070 is_offscreen ? offscreen_size_ : surface_->GetSize());
9068 } 9071 }
(...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after
10734 } 10737 }
10735 } 10738 }
10736 10739
10737 // Include the auto-generated part of this file. We split this because it means 10740 // Include the auto-generated part of this file. We split this because it means
10738 // we can easily edit the non-auto generated parts right here in this file 10741 // we can easily edit the non-auto generated parts right here in this file
10739 // instead of having to edit some template or the code generator. 10742 // instead of having to edit some template or the code generator.
10740 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 10743 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
10741 10744
10742 } // namespace gles2 10745 } // namespace gles2
10743 } // namespace gpu 10746 } // namespace gpu
OLDNEW
« no previous file with comments | « base/debug/trace_event_impl.h ('k') | tools/perf/measurements/smoothness_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698