| 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 2555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2566 | 2566 |
| 2567 DoBindBuffer(GL_ARRAY_BUFFER, 0); | 2567 DoBindBuffer(GL_ARRAY_BUFFER, 0); |
| 2568 DoBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); | 2568 DoBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); |
| 2569 DoBindFramebuffer(GL_FRAMEBUFFER, 0); | 2569 DoBindFramebuffer(GL_FRAMEBUFFER, 0); |
| 2570 DoBindRenderbuffer(GL_RENDERBUFFER, 0); | 2570 DoBindRenderbuffer(GL_RENDERBUFFER, 0); |
| 2571 | 2571 |
| 2572 if (feature_info_->workarounds().reverse_point_sprite_coord_origin) { | 2572 if (feature_info_->workarounds().reverse_point_sprite_coord_origin) { |
| 2573 glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT); | 2573 glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT); |
| 2574 } | 2574 } |
| 2575 | 2575 |
| 2576 // Only compositor contexts are known to use only the subset of GL |
| 2577 // that can be safely migrated between the iGPU and the dGPU. Mark |
| 2578 // those contexts as safe to forcibly transition between the GPUs. |
| 2579 // http://crbug.com/180876, http://crbug.com/227228 |
| 2580 if (!offscreen) |
| 2581 context_->SetSafeToForceGpuSwitch(); |
| 2582 |
| 2576 // Create a delegate to perform async pixel transfers. | 2583 // Create a delegate to perform async pixel transfers. |
| 2577 async_pixel_transfer_delegate_ = | 2584 async_pixel_transfer_delegate_ = |
| 2578 gfx::AsyncPixelTransferDelegate::Create(context.get()); | 2585 gfx::AsyncPixelTransferDelegate::Create(context.get()); |
| 2579 | 2586 |
| 2580 return true; | 2587 return true; |
| 2581 } | 2588 } |
| 2582 | 2589 |
| 2583 void GLES2DecoderImpl::UpdateCapabilities() { | 2590 void GLES2DecoderImpl::UpdateCapabilities() { |
| 2584 util_.set_num_compressed_texture_formats( | 2591 util_.set_num_compressed_texture_formats( |
| 2585 validators_->compressed_texture_format.GetValues().size()); | 2592 validators_->compressed_texture_format.GetValues().size()); |
| (...skipping 7947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10533 return error::kNoError; | 10540 return error::kNoError; |
| 10534 } | 10541 } |
| 10535 | 10542 |
| 10536 // Include the auto-generated part of this file. We split this because it means | 10543 // Include the auto-generated part of this file. We split this because it means |
| 10537 // we can easily edit the non-auto generated parts right here in this file | 10544 // we can easily edit the non-auto generated parts right here in this file |
| 10538 // instead of having to edit some template or the code generator. | 10545 // instead of having to edit some template or the code generator. |
| 10539 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10546 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 10540 | 10547 |
| 10541 } // namespace gles2 | 10548 } // namespace gles2 |
| 10542 } // namespace gpu | 10549 } // namespace gpu |
| OLD | NEW |