Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 2094803005: Fix PrepareTextureCopyOutputResult to avoid ScopedCallbackRunner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_closure_runner
Patch Set: RunAndReset Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« content/browser/compositor/surface_utils.cc ('K') | « content/browser/compositor/surface_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698