OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 6548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6559 } | 6559 } |
6560 // TODO(gman): call glShaderBinary | 6560 // TODO(gman): call glShaderBinary |
6561 return error::kNoError; | 6561 return error::kNoError; |
6562 #endif | 6562 #endif |
6563 } | 6563 } |
6564 | 6564 |
6565 error::Error GLES2DecoderImpl::HandleSwapBuffers( | 6565 error::Error GLES2DecoderImpl::HandleSwapBuffers( |
6566 uint32 immediate_data_size, const gles2::SwapBuffers& c) { | 6566 uint32 immediate_data_size, const gles2::SwapBuffers& c) { |
6567 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); | 6567 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); |
6568 int this_frame_number = frame_number_++; | 6568 int this_frame_number = frame_number_++; |
| 6569 // This event is used by frame_rate_tests: |
| 6570 TRACE_EVENT_INSTANT1("test_frame_rate_tests", "SwapBuffers", "is_GPU", |
| 6571 gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL || |
| 6572 gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2); |
6569 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", | 6573 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", |
6570 "offscreen", is_offscreen, | 6574 "offscreen", is_offscreen, |
6571 "frame", this_frame_number); | 6575 "frame", this_frame_number); |
6572 // If offscreen then don't actually SwapBuffers to the display. Just copy | 6576 // If offscreen then don't actually SwapBuffers to the display. Just copy |
6573 // the rendered frame to another frame buffer. | 6577 // the rendered frame to another frame buffer. |
6574 if (is_offscreen) { | 6578 if (is_offscreen) { |
6575 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { | 6579 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { |
6576 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, | 6580 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, |
6577 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will | 6581 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will |
6578 // fix this. | 6582 // fix this. |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6870 return false; | 6874 return false; |
6871 } | 6875 } |
6872 | 6876 |
6873 // Include the auto-generated part of this file. We split this because it means | 6877 // Include the auto-generated part of this file. We split this because it means |
6874 // we can easily edit the non-auto generated parts right here in this file | 6878 // we can easily edit the non-auto generated parts right here in this file |
6875 // instead of having to edit some template or the code generator. | 6879 // instead of having to edit some template or the code generator. |
6876 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 6880 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
6877 | 6881 |
6878 } // namespace gles2 | 6882 } // namespace gles2 |
6879 } // namespace gpu | 6883 } // namespace gpu |
OLD | NEW |