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 <list> | 10 #include <list> |
(...skipping 8182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8193 } | 8193 } |
8194 | 8194 |
8195 error::Error GLES2DecoderImpl::HandleSwapBuffers( | 8195 error::Error GLES2DecoderImpl::HandleSwapBuffers( |
8196 uint32 immediate_data_size, const gles2::SwapBuffers& c) { | 8196 uint32 immediate_data_size, const gles2::SwapBuffers& c) { |
8197 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); | 8197 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); |
8198 if (!is_offscreen && surface_->DeferSwapBuffers()) { | 8198 if (!is_offscreen && surface_->DeferSwapBuffers()) { |
8199 return error::kDeferCommandUntilLater; | 8199 return error::kDeferCommandUntilLater; |
8200 } | 8200 } |
8201 | 8201 |
8202 int this_frame_number = frame_number_++; | 8202 int this_frame_number = frame_number_++; |
| 8203 // TRACE_EVENT for gpu tests: |
| 8204 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffersLatency", |
| 8205 "GLImpl", static_cast<int>(gfx::GetGLImplementation()), |
| 8206 "width", (is_offscreen ? offscreen_size_.width() : |
| 8207 surface_->GetSize().width())); |
8203 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", | 8208 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", |
8204 "offscreen", is_offscreen, | 8209 "offscreen", is_offscreen, |
8205 "frame", this_frame_number); | 8210 "frame", this_frame_number); |
8206 // If offscreen then don't actually SwapBuffers to the display. Just copy | 8211 // If offscreen then don't actually SwapBuffers to the display. Just copy |
8207 // the rendered frame to another frame buffer. | 8212 // the rendered frame to another frame buffer. |
8208 if (is_offscreen) { | 8213 if (is_offscreen) { |
8209 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { | 8214 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { |
8210 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, | 8215 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, |
8211 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will | 8216 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will |
8212 // fix this. | 8217 // fix this. |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9151 BindAndApplyTextureParameters(info); | 9156 BindAndApplyTextureParameters(info); |
9152 } | 9157 } |
9153 | 9158 |
9154 // Include the auto-generated part of this file. We split this because it means | 9159 // Include the auto-generated part of this file. We split this because it means |
9155 // we can easily edit the non-auto generated parts right here in this file | 9160 // we can easily edit the non-auto generated parts right here in this file |
9156 // instead of having to edit some template or the code generator. | 9161 // instead of having to edit some template or the code generator. |
9157 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 9162 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
9158 | 9163 |
9159 } // namespace gles2 | 9164 } // namespace gles2 |
9160 } // namespace gpu | 9165 } // namespace gpu |
OLD | NEW |