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 2044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2055 #elif defined(OS_WIN) | 2055 #elif defined(OS_WIN) |
2056 if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) | 2056 if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) |
2057 needs_glsl_built_in_function_emulation_ = true; | 2057 needs_glsl_built_in_function_emulation_ = true; |
2058 #endif | 2058 #endif |
2059 } | 2059 } |
2060 | 2060 |
2061 if (!InitializeShaderTranslator()) { | 2061 if (!InitializeShaderTranslator()) { |
2062 return false; | 2062 return false; |
2063 } | 2063 } |
2064 | 2064 |
2065 // TRACE_EVENT for gpu tests: | |
2066 TRACE_EVENT_INSTANT1("test_gpu", "GLES2DecoderImpl::Initialize", "GLImpl", | |
2067 static_cast<int>(gfx::GetGLImplementation())); | |
2068 | |
2069 return true; | 2065 return true; |
2070 } | 2066 } |
2071 | 2067 |
2072 void GLES2DecoderImpl::UpdateCapabilities() { | 2068 void GLES2DecoderImpl::UpdateCapabilities() { |
2073 util_.set_num_compressed_texture_formats( | 2069 util_.set_num_compressed_texture_formats( |
2074 validators_->compressed_texture_format.GetValues().size()); | 2070 validators_->compressed_texture_format.GetValues().size()); |
2075 util_.set_num_shader_binary_formats( | 2071 util_.set_num_shader_binary_formats( |
2076 validators_->shader_binary_format.GetValues().size()); | 2072 validators_->shader_binary_format.GetValues().size()); |
2077 } | 2073 } |
2078 | 2074 |
(...skipping 5002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7081 } | 7077 } |
7082 // TODO(gman): call glShaderBinary | 7078 // TODO(gman): call glShaderBinary |
7083 return error::kNoError; | 7079 return error::kNoError; |
7084 #endif | 7080 #endif |
7085 } | 7081 } |
7086 | 7082 |
7087 error::Error GLES2DecoderImpl::HandleSwapBuffers( | 7083 error::Error GLES2DecoderImpl::HandleSwapBuffers( |
7088 uint32 immediate_data_size, const gles2::SwapBuffers& c) { | 7084 uint32 immediate_data_size, const gles2::SwapBuffers& c) { |
7089 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); | 7085 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); |
7090 int this_frame_number = frame_number_++; | 7086 int this_frame_number = frame_number_++; |
| 7087 // TRACE_EVENT for gpu tests: |
| 7088 TRACE_EVENT_INSTANT1("test_gpu", "SwapBuffers", |
| 7089 "GLImpl", static_cast<int>(gfx::GetGLImplementation())); |
7091 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", | 7090 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", |
7092 "offscreen", is_offscreen, | 7091 "offscreen", is_offscreen, |
7093 "frame", this_frame_number); | 7092 "frame", this_frame_number); |
7094 // If offscreen then don't actually SwapBuffers to the display. Just copy | 7093 // If offscreen then don't actually SwapBuffers to the display. Just copy |
7095 // the rendered frame to another frame buffer. | 7094 // the rendered frame to another frame buffer. |
7096 if (is_offscreen) { | 7095 if (is_offscreen) { |
7097 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { | 7096 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { |
7098 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, | 7097 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, |
7099 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will | 7098 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will |
7100 // fix this. | 7099 // fix this. |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7485 return error::kNoError; | 7484 return error::kNoError; |
7486 } | 7485 } |
7487 | 7486 |
7488 // Include the auto-generated part of this file. We split this because it means | 7487 // Include the auto-generated part of this file. We split this because it means |
7489 // we can easily edit the non-auto generated parts right here in this file | 7488 // we can easily edit the non-auto generated parts right here in this file |
7490 // instead of having to edit some template or the code generator. | 7489 // instead of having to edit some template or the code generator. |
7491 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 7490 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
7492 | 7491 |
7493 } // namespace gles2 | 7492 } // namespace gles2 |
7494 } // namespace gpu | 7493 } // namespace gpu |
OLD | NEW |