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 "content/browser/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 void CopyFromCompositingSurfaceFinished( | 101 void CopyFromCompositingSurfaceFinished( |
102 const base::Callback<void(bool, const SkBitmap&)>& callback, | 102 const base::Callback<void(bool, const SkBitmap&)>& callback, |
103 scoped_ptr<cc::SingleReleaseCallback> release_callback, | 103 scoped_ptr<cc::SingleReleaseCallback> release_callback, |
104 scoped_ptr<SkBitmap> bitmap, | 104 scoped_ptr<SkBitmap> bitmap, |
105 const base::TimeTicks& start_time, | 105 const base::TimeTicks& start_time, |
106 scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock, | 106 scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock, |
107 bool result) { | 107 bool result) { |
108 TRACE_EVENT0( | 108 TRACE_EVENT0( |
109 "cc", "RenderWidgetHostViewAndroid::CopyFromCompositingSurfaceFinished"); | 109 "cc", "RenderWidgetHostViewAndroid::CopyFromCompositingSurfaceFinished"); |
110 bitmap_pixels_lock.reset(); | 110 bitmap_pixels_lock.reset(); |
111 release_callback->Run(0, false); | 111 uint32 sync_point = 0; |
| 112 if (result) { |
| 113 GLHelper* gl_helper = |
| 114 ImageTransportFactoryAndroid::GetInstance()->GetGLHelper(); |
| 115 sync_point = gl_helper->InsertSyncPoint(); |
| 116 } |
| 117 bool lost_resource = sync_point == 0; |
| 118 release_callback->Run(sync_point, lost_resource); |
112 UMA_HISTOGRAM_TIMES(kAsyncReadBackString, | 119 UMA_HISTOGRAM_TIMES(kAsyncReadBackString, |
113 base::TimeTicks::Now() - start_time); | 120 base::TimeTicks::Now() - start_time); |
114 callback.Run(result, *bitmap); | 121 callback.Run(result, *bitmap); |
115 } | 122 } |
116 | 123 |
117 ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent& event) { | 124 ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent& event) { |
118 ui::LatencyInfo latency_info; | 125 ui::LatencyInfo latency_info; |
119 // The latency number should only be added if the timestamp is valid. | 126 // The latency number should only be added if the timestamp is valid. |
120 if (event.timeStampSeconds) { | 127 if (event.timeStampSeconds) { |
121 const int64 time_micros = static_cast<int64>( | 128 const int64 time_micros = static_cast<int64>( |
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1850 results->orientationAngle = display.RotationAsDegree(); | 1857 results->orientationAngle = display.RotationAsDegree(); |
1851 results->orientationType = | 1858 results->orientationType = |
1852 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1859 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1853 gfx::DeviceDisplayInfo info; | 1860 gfx::DeviceDisplayInfo info; |
1854 results->depth = info.GetBitsPerPixel(); | 1861 results->depth = info.GetBitsPerPixel(); |
1855 results->depthPerComponent = info.GetBitsPerComponent(); | 1862 results->depthPerComponent = info.GetBitsPerComponent(); |
1856 results->isMonochrome = (results->depthPerComponent == 0); | 1863 results->isMonochrome = (results->depthPerComponent == 0); |
1857 } | 1864 } |
1858 | 1865 |
1859 } // namespace content | 1866 } // namespace content |
OLD | NEW |