| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ipc/service/image_transport_surface_overlay_mac.h" | 5 #include "gpu/ipc/service/image_transport_surface_overlay_mac.h" |
| 6 | 6 |
| 7 #include <CoreGraphics/CoreGraphics.h> | 7 #include <CoreGraphics/CoreGraphics.h> |
| 8 #include <IOSurface/IOSurface.h> | 8 #include <IOSurface/IOSurface.h> |
| 9 #include <OpenGL/CGLRenderers.h> | 9 #include <OpenGL/CGLRenderers.h> |
| 10 #include <OpenGL/CGLTypes.h> | 10 #include <OpenGL/CGLTypes.h> |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 { | 169 { |
| 170 gfx::ScopedSetGLToRealGLApi scoped_set_gl_api; | 170 gfx::ScopedSetGLToRealGLApi scoped_set_gl_api; |
| 171 TRACE_EVENT0("gpu", "ImageTransportSurfaceOverlayMac::glFinish"); | 171 TRACE_EVENT0("gpu", "ImageTransportSurfaceOverlayMac::glFinish"); |
| 172 CheckGLErrors("Before finish"); | 172 CheckGLErrors("Before finish"); |
| 173 glFinish(); | 173 glFinish(); |
| 174 CheckGLErrors("After finish"); | 174 CheckGLErrors("After finish"); |
| 175 } | 175 } |
| 176 | 176 |
| 177 base::TimeTicks finish_time = base::TimeTicks::Now(); | 177 base::TimeTicks finish_time = base::TimeTicks::Now(); |
| 178 | 178 |
| 179 ca_layer_tree_coordinator_->CommitPendingTreesToCA(pixel_damage_rect); | 179 bool fullscreen_low_power_layer_valid = false; |
| 180 ca_layer_tree_coordinator_->CommitPendingTreesToCA( |
| 181 pixel_damage_rect, &fullscreen_low_power_layer_valid); |
| 182 // TODO(ccameron): Plumb the fullscreen low power layer through to the |
| 183 // appropriate window. |
| 180 | 184 |
| 181 // Update the latency info to reflect the swap time. | 185 // Update the latency info to reflect the swap time. |
| 182 for (auto latency_info : latency_info_) { | 186 for (auto latency_info : latency_info_) { |
| 183 latency_info.AddLatencyNumberWithTimestamp( | 187 latency_info.AddLatencyNumberWithTimestamp( |
| 184 ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0, finish_time, 1); | 188 ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0, finish_time, 1); |
| 185 latency_info.AddLatencyNumberWithTimestamp( | 189 latency_info.AddLatencyNumberWithTimestamp( |
| 186 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0, | 190 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0, |
| 187 finish_time, 1); | 191 finish_time, 1); |
| 188 } | 192 } |
| 189 | 193 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 gl_renderer_id_ = context_renderer_id & kCGLRendererIDMatchingMask; | 317 gl_renderer_id_ = context_renderer_id & kCGLRendererIDMatchingMask; |
| 314 | 318 |
| 315 // Post a task holding a reference to the new GL context. The reason for | 319 // Post a task holding a reference to the new GL context. The reason for |
| 316 // this is to avoid creating-then-destroying the context for every image | 320 // this is to avoid creating-then-destroying the context for every image |
| 317 // transport surface that is observing the GPU switch. | 321 // transport surface that is observing the GPU switch. |
| 318 base::MessageLoop::current()->PostTask( | 322 base::MessageLoop::current()->PostTask( |
| 319 FROM_HERE, base::Bind(&IOSurfaceContextNoOp, context_on_new_gpu)); | 323 FROM_HERE, base::Bind(&IOSurfaceContextNoOp, context_on_new_gpu)); |
| 320 } | 324 } |
| 321 | 325 |
| 322 } // namespace gpu | 326 } // namespace gpu |
| OLD | NEW |