Chromium Code Reviews| 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 9351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9362 offscreen_saved_color_format_); | 9362 offscreen_saved_color_format_); |
| 9363 } else { | 9363 } else { |
| 9364 // Flip the textures in the parent context via the texture manager. | 9364 // Flip the textures in the parent context via the texture manager. |
| 9365 if (!!offscreen_saved_color_texture_info_.get()) | 9365 if (!!offscreen_saved_color_texture_info_.get()) |
| 9366 offscreen_saved_color_texture_info_->texture()-> | 9366 offscreen_saved_color_texture_info_->texture()-> |
| 9367 SetServiceId(offscreen_target_color_texture_->id()); | 9367 SetServiceId(offscreen_target_color_texture_->id()); |
| 9368 | 9368 |
| 9369 offscreen_saved_color_texture_.swap(offscreen_target_color_texture_); | 9369 offscreen_saved_color_texture_.swap(offscreen_target_color_texture_); |
| 9370 offscreen_target_frame_buffer_->AttachRenderTexture( | 9370 offscreen_target_frame_buffer_->AttachRenderTexture( |
| 9371 offscreen_target_color_texture_.get()); | 9371 offscreen_target_color_texture_.get()); |
| 9372 | |
| 9373 // Explicitly discard framebuffer to save GPU memory bandwidth for | |
| 9374 // tile-based GPU arch. | |
| 9375 if (feature_info_->feature_flags().ext_discard_framebuffer) { | |
|
Hongbo Min
2014/10/14 02:27:48
According to my previous work, an attempt to clear
dshwang
2014/10/14 12:09:30
As far as I understand, your CL didn't affect whet
| |
| 9376 const GLenum attachments[3] = { | |
| 9377 GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT}; | |
| 9378 glDiscardFramebufferEXT(GL_FRAMEBUFFER, 3, attachments); | |
| 9379 } | |
| 9372 } | 9380 } |
| 9373 | 9381 |
| 9374 // Ensure the side effects of the copy are visible to the parent | 9382 // Ensure the side effects of the copy are visible to the parent |
| 9375 // context. There is no need to do this for ANGLE because it uses a | 9383 // context. There is no need to do this for ANGLE because it uses a |
| 9376 // single D3D device for all contexts. | 9384 // single D3D device for all contexts. |
| 9377 if (!feature_info_->feature_flags().is_angle) | 9385 if (!feature_info_->feature_flags().is_angle) |
| 9378 glFlush(); | 9386 glFlush(); |
| 9379 } | 9387 } |
| 9380 } else { | 9388 } else { |
| 9381 if (!surface_->SwapBuffers()) { | 9389 if (!surface_->SwapBuffers()) { |
| (...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11145 } | 11153 } |
| 11146 } | 11154 } |
| 11147 | 11155 |
| 11148 // Include the auto-generated part of this file. We split this because it means | 11156 // Include the auto-generated part of this file. We split this because it means |
| 11149 // we can easily edit the non-auto generated parts right here in this file | 11157 // we can easily edit the non-auto generated parts right here in this file |
| 11150 // instead of having to edit some template or the code generator. | 11158 // instead of having to edit some template or the code generator. |
| 11151 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 11159 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 11152 | 11160 |
| 11153 } // namespace gles2 | 11161 } // namespace gles2 |
| 11154 } // namespace gpu | 11162 } // namespace gpu |
| OLD | NEW |