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 8215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8226 } | 8226 } |
8227 | 8227 |
8228 error::Error GLES2DecoderImpl::HandleSwapBuffers( | 8228 error::Error GLES2DecoderImpl::HandleSwapBuffers( |
8229 uint32 immediate_data_size, const gles2::SwapBuffers& c) { | 8229 uint32 immediate_data_size, const gles2::SwapBuffers& c) { |
8230 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); | 8230 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); |
8231 if (!is_offscreen && surface_->DeferSwapBuffers()) { | 8231 if (!is_offscreen && surface_->DeferSwapBuffers()) { |
8232 return error::kDeferCommandUntilLater; | 8232 return error::kDeferCommandUntilLater; |
8233 } | 8233 } |
8234 | 8234 |
8235 int this_frame_number = frame_number_++; | 8235 int this_frame_number = frame_number_++; |
8236 // TRACE_EVENT for gpu tests: | |
8237 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffers", | |
jbates
2012/07/18 22:50:28
why did this move? it changed the windows WebGL la
jonathan.backer
2012/07/19 13:04:31
This moved because I had CrOS use a real display f
| |
8238 "GLImpl", static_cast<int>(gfx::GetGLImplementation()), | |
8239 "width", (is_offscreen ? offscreen_size_.width() : | |
8240 surface_->GetSize().width())); | |
8241 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", | 8236 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", |
8242 "offscreen", is_offscreen, | 8237 "offscreen", is_offscreen, |
8243 "frame", this_frame_number); | 8238 "frame", this_frame_number); |
8244 // If offscreen then don't actually SwapBuffers to the display. Just copy | 8239 // If offscreen then don't actually SwapBuffers to the display. Just copy |
8245 // the rendered frame to another frame buffer. | 8240 // the rendered frame to another frame buffer. |
8246 if (is_offscreen) { | 8241 if (is_offscreen) { |
8247 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { | 8242 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { |
8248 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, | 8243 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, |
8249 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will | 8244 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will |
8250 // fix this. | 8245 // fix this. |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9189 BindAndApplyTextureParameters(info); | 9184 BindAndApplyTextureParameters(info); |
9190 } | 9185 } |
9191 | 9186 |
9192 // Include the auto-generated part of this file. We split this because it means | 9187 // Include the auto-generated part of this file. We split this because it means |
9193 // we can easily edit the non-auto generated parts right here in this file | 9188 // we can easily edit the non-auto generated parts right here in this file |
9194 // instead of having to edit some template or the code generator. | 9189 // instead of having to edit some template or the code generator. |
9195 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 9190 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
9196 | 9191 |
9197 } // namespace gles2 | 9192 } // namespace gles2 |
9198 } // namespace gpu | 9193 } // namespace gpu |
OLD | NEW |