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 <OpenGL/CGLRenderers.h> | 7 #include <OpenGL/CGLRenderers.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/mac/sdk_forward_declarations.h" | 10 #include "base/mac/sdk_forward_declarations.h" |
11 #include "content/common/gpu/surface_handle_types_mac.h" | 11 #include "ui/accelerated_widget_mac/surface_handle_types.h" |
12 #include "ui/base/cocoa/animation_utils.h" | 12 #include "ui/base/cocoa/animation_utils.h" |
13 #include "ui/gfx/geometry/size_conversions.h" | 13 #include "ui/gfx/geometry/size_conversions.h" |
14 #include "ui/gl/gl_gl_api_implementation.h" | 14 #include "ui/gl/gl_gl_api_implementation.h" |
15 #include "ui/gl/gl_switches.h" | 15 #include "ui/gl/gl_switches.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 const size_t kFramesToKeepCAContextAfterDiscard = 2; | 18 const size_t kFramesToKeepCAContextAfterDiscard = 2; |
19 } | 19 } |
20 | 20 |
21 @interface ImageTransportLayer : CAOpenGLLayer { | 21 @interface ImageTransportLayer : CAOpenGLLayer { |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 // now never come, so release the pressure now. | 330 // now never come, so release the pressure now. |
331 UnblockBrowserIfNeeded(); | 331 UnblockBrowserIfNeeded(); |
332 } | 332 } |
333 | 333 |
334 void CALayerStorageProvider::UnblockBrowserIfNeeded() { | 334 void CALayerStorageProvider::UnblockBrowserIfNeeded() { |
335 if (!has_pending_draw_) | 335 if (!has_pending_draw_) |
336 return; | 336 return; |
337 pending_draw_weak_factory_.InvalidateWeakPtrs(); | 337 pending_draw_weak_factory_.InvalidateWeakPtrs(); |
338 has_pending_draw_ = false; | 338 has_pending_draw_ = false; |
339 transport_surface_->SendSwapBuffers( | 339 transport_surface_->SendSwapBuffers( |
340 SurfaceHandleFromCAContextID([context_ contextId]), | 340 ui::SurfaceHandleFromCAContextID([context_ contextId]), |
341 fbo_pixel_size_, | 341 fbo_pixel_size_, |
342 fbo_scale_factor_); | 342 fbo_scale_factor_); |
343 } | 343 } |
344 | 344 |
345 } // namespace content | 345 } // namespace content |
OLD | NEW |