| 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/browser/compositor/software_browser_compositor_output_surface.
h" | 5 #include "content/browser/compositor/software_browser_compositor_output_surface.
h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 void SoftwareBrowserCompositorOutputSurface::DiscardBackbuffer() { | 40 void SoftwareBrowserCompositorOutputSurface::DiscardBackbuffer() { |
| 41 software_device()->DiscardBackbuffer(); | 41 software_device()->DiscardBackbuffer(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void SoftwareBrowserCompositorOutputSurface::BindFramebuffer() { | 44 void SoftwareBrowserCompositorOutputSurface::BindFramebuffer() { |
| 45 // Not used for software surfaces. | 45 // Not used for software surfaces. |
| 46 NOTREACHED(); | 46 NOTREACHED(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void SoftwareBrowserCompositorOutputSurface::Reshape( |
| 50 const gfx::Size& size, |
| 51 float device_scale_factor, |
| 52 const gfx::ColorSpace& color_space, |
| 53 bool has_alpha) { |
| 54 software_device()->Resize(size, device_scale_factor); |
| 55 } |
| 56 |
| 49 void SoftwareBrowserCompositorOutputSurface::SwapBuffers( | 57 void SoftwareBrowserCompositorOutputSurface::SwapBuffers( |
| 50 cc::OutputSurfaceFrame frame) { | 58 cc::OutputSurfaceFrame frame) { |
| 51 base::TimeTicks swap_time = base::TimeTicks::Now(); | 59 base::TimeTicks swap_time = base::TimeTicks::Now(); |
| 52 for (auto& latency : frame.latency_info) { | 60 for (auto& latency : frame.latency_info) { |
| 53 latency.AddLatencyNumberWithTimestamp( | 61 latency.AddLatencyNumberWithTimestamp( |
| 54 ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0, swap_time, 1); | 62 ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0, swap_time, 1); |
| 55 latency.AddLatencyNumberWithTimestamp( | 63 latency.AddLatencyNumberWithTimestamp( |
| 56 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0, | 64 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0, |
| 57 swap_time, 1); | 65 swap_time, 1); |
| 58 } | 66 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 NOTREACHED(); | 104 NOTREACHED(); |
| 97 } | 105 } |
| 98 | 106 |
| 99 #if defined(OS_MACOSX) | 107 #if defined(OS_MACOSX) |
| 100 void SoftwareBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle( | 108 void SoftwareBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle( |
| 101 bool suspended) { | 109 bool suspended) { |
| 102 } | 110 } |
| 103 #endif | 111 #endif |
| 104 | 112 |
| 105 } // namespace content | 113 } // namespace content |
| OLD | NEW |