| 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 2556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2567 DoBindFramebuffer(GL_FRAMEBUFFER, 0); | 2567 DoBindFramebuffer(GL_FRAMEBUFFER, 0); |
| 2568 DoBindRenderbuffer(GL_RENDERBUFFER, 0); | 2568 DoBindRenderbuffer(GL_RENDERBUFFER, 0); |
| 2569 | 2569 |
| 2570 // AMD and Intel drivers on Mac OS apparently get gl_PointCoord | 2570 // AMD and Intel drivers on Mac OS apparently get gl_PointCoord |
| 2571 // backward from the spec and this setting makes them work | 2571 // backward from the spec and this setting makes them work |
| 2572 // correctly. rdar://problem/11883495 | 2572 // correctly. rdar://problem/11883495 |
| 2573 if (feature_info_->workarounds().reverse_point_sprite_coord_origin) { | 2573 if (feature_info_->workarounds().reverse_point_sprite_coord_origin) { |
| 2574 glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT); | 2574 glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT); |
| 2575 } | 2575 } |
| 2576 | 2576 |
| 2577 // Only compositor contexts are known to use only the subset of GL |
| 2578 // that can be safely migrated between the iGPU and the dGPU. Mark |
| 2579 // those contexts as safe to forcibly transition between the GPUs. |
| 2580 // http://crbug.com/180876, http://crbug.com/227228 |
| 2581 if (!offscreen) |
| 2582 context_->SetSafeToForceGpuSwitch(); |
| 2583 |
| 2577 // Create a delegate to perform async pixel transfers. | 2584 // Create a delegate to perform async pixel transfers. |
| 2578 async_pixel_transfer_delegate_ = | 2585 async_pixel_transfer_delegate_ = |
| 2579 gfx::AsyncPixelTransferDelegate::Create(context.get()); | 2586 gfx::AsyncPixelTransferDelegate::Create(context.get()); |
| 2580 | 2587 |
| 2581 return true; | 2588 return true; |
| 2582 } | 2589 } |
| 2583 | 2590 |
| 2584 void GLES2DecoderImpl::UpdateCapabilities() { | 2591 void GLES2DecoderImpl::UpdateCapabilities() { |
| 2585 util_.set_num_compressed_texture_formats( | 2592 util_.set_num_compressed_texture_formats( |
| 2586 validators_->compressed_texture_format.GetValues().size()); | 2593 validators_->compressed_texture_format.GetValues().size()); |
| (...skipping 7896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10483 return error::kNoError; | 10490 return error::kNoError; |
| 10484 } | 10491 } |
| 10485 | 10492 |
| 10486 // Include the auto-generated part of this file. We split this because it means | 10493 // Include the auto-generated part of this file. We split this because it means |
| 10487 // we can easily edit the non-auto generated parts right here in this file | 10494 // we can easily edit the non-auto generated parts right here in this file |
| 10488 // instead of having to edit some template or the code generator. | 10495 // instead of having to edit some template or the code generator. |
| 10489 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10496 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 10490 | 10497 |
| 10491 } // namespace gles2 | 10498 } // namespace gles2 |
| 10492 } // namespace gpu | 10499 } // namespace gpu |
| OLD | NEW |