| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/common/gpu/image_transport_surface_calayer_mac.h" | 5 #include "content/common/gpu/image_transport_surface_calayer_mac.h" |
| 6 | 6 |
| 7 #include <IOSurface/IOSurface.h> | 7 #include <IOSurface/IOSurface.h> |
| 8 #include <OpenGL/CGLRenderers.h> | 8 #include <OpenGL/CGLRenderers.h> |
| 9 #include <OpenGL/CGLIOSurface.h> | 9 #include <OpenGL/CGLIOSurface.h> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/mac/sdk_forward_declarations.h" | 12 #include "base/mac/sdk_forward_declarations.h" |
| 13 #include "base/trace_event/trace_event.h" | 13 #include "base/trace_event/trace_event.h" |
| 14 #include "gpu/config/gpu_info_collector.h" | 14 #include "gpu/config/gpu_info_collector.h" |
| 15 #include "ui/accelerated_widget_mac/surface_handle_types.h" | 15 #include "ui/accelerated_widget_mac/surface_handle_types.h" |
| 16 #include "ui/base/cocoa/animation_utils.h" | 16 #include "ui/base/cocoa/animation_utils.h" |
| 17 #include "ui/gfx/geometry/dip_util.h" | 17 #include "ui/gfx/geometry/dip_util.h" |
| 18 #include "ui/gfx/geometry/size_conversions.h" | 18 #include "ui/gfx/geometry/size_conversions.h" |
| 19 #include "ui/gl/gl_gl_api_implementation.h" |
| 19 #include "ui/gl/gl_switches.h" | 20 #include "ui/gl/gl_switches.h" |
| 20 #include "ui/gl/gpu_switching_manager.h" | 21 #include "ui/gl/gpu_switching_manager.h" |
| 21 #include "ui/gl/scoped_api.h" | |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 const size_t kFramesToKeepCAContextAfterDiscard = 2; | 24 const size_t kFramesToKeepCAContextAfterDiscard = 2; |
| 25 const size_t kCanDrawFalsesBeforeSwitchFromAsync = 4; | 25 const size_t kCanDrawFalsesBeforeSwitchFromAsync = 4; |
| 26 const base::TimeDelta kMinDeltaToSwitchToAsync = | 26 const base::TimeDelta kMinDeltaToSwitchToAsync = |
| 27 base::TimeDelta::FromSecondsD(1. / 15.); | 27 base::TimeDelta::FromSecondsD(1. / 15.); |
| 28 | 28 |
| 29 | 29 |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 if (ca_opengl_layer_) { | 640 if (ca_opengl_layer_) { |
| 641 [ca_opengl_layer_ resetStorageProvider]; | 641 [ca_opengl_layer_ resetStorageProvider]; |
| 642 // If we are providing back-pressure by waiting for a draw, that draw will | 642 // If we are providing back-pressure by waiting for a draw, that draw will |
| 643 // now never come, so release the pressure now. | 643 // now never come, so release the pressure now. |
| 644 UnblockBrowserIfNeeded(); | 644 UnblockBrowserIfNeeded(); |
| 645 ca_opengl_layer_.reset(); | 645 ca_opengl_layer_.reset(); |
| 646 } | 646 } |
| 647 } | 647 } |
| 648 | 648 |
| 649 } // namespace content | 649 } // namespace content |
| OLD | NEW |