| 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 <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1933 if (dst_size_in_pixel.IsEmpty()) | 1933 if (dst_size_in_pixel.IsEmpty()) |
| 1934 output_size_in_pixel = result->size(); | 1934 output_size_in_pixel = result->size(); |
| 1935 else | 1935 else |
| 1936 output_size_in_pixel = dst_size_in_pixel; | 1936 output_size_in_pixel = dst_size_in_pixel; |
| 1937 | 1937 |
| 1938 std::unique_ptr<SkBitmap> bitmap(new SkBitmap); | 1938 std::unique_ptr<SkBitmap> bitmap(new SkBitmap); |
| 1939 if (!bitmap->tryAllocPixels(SkImageInfo::Make(output_size_in_pixel.width(), | 1939 if (!bitmap->tryAllocPixels(SkImageInfo::Make(output_size_in_pixel.width(), |
| 1940 output_size_in_pixel.height(), | 1940 output_size_in_pixel.height(), |
| 1941 color_type, | 1941 color_type, |
| 1942 kOpaque_SkAlphaType))) { | 1942 kOpaque_SkAlphaType))) { |
| 1943 scoped_callback_runner.Reset( | 1943 scoped_callback_runner.ReplaceClosure( |
| 1944 base::Bind(callback, SkBitmap(), READBACK_BITMAP_ALLOCATION_FAILURE)); | 1944 base::Bind(callback, SkBitmap(), READBACK_BITMAP_ALLOCATION_FAILURE)); |
| 1945 return; | 1945 return; |
| 1946 } | 1946 } |
| 1947 | 1947 |
| 1948 std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock( | 1948 std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock( |
| 1949 new SkAutoLockPixels(*bitmap)); | 1949 new SkAutoLockPixels(*bitmap)); |
| 1950 uint8_t* pixels = static_cast<uint8_t*>(bitmap->getPixels()); | 1950 uint8_t* pixels = static_cast<uint8_t*>(bitmap->getPixels()); |
| 1951 | 1951 |
| 1952 ignore_result(scoped_callback_runner.Release()); | 1952 ignore_result(scoped_callback_runner.Release()); |
| 1953 | 1953 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2022 case ui::MotionEvent::ACTION_UP: | 2022 case ui::MotionEvent::ACTION_UP: |
| 2023 case ui::MotionEvent::ACTION_POINTER_UP: | 2023 case ui::MotionEvent::ACTION_POINTER_UP: |
| 2024 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", | 2024 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", |
| 2025 delta.InMicroseconds(), 1, 1000000, 50); | 2025 delta.InMicroseconds(), 1, 1000000, 50); |
| 2026 default: | 2026 default: |
| 2027 return; | 2027 return; |
| 2028 } | 2028 } |
| 2029 } | 2029 } |
| 2030 | 2030 |
| 2031 } // namespace content | 2031 } // namespace content |
| OLD | NEW |