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

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: . 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
« no previous file with comments | « content/browser/compositor/surface_utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 if (dst_size_in_pixel.IsEmpty()) 1901 if (dst_size_in_pixel.IsEmpty())
1902 output_size_in_pixel = result->size(); 1902 output_size_in_pixel = result->size();
1903 else 1903 else
1904 output_size_in_pixel = dst_size_in_pixel; 1904 output_size_in_pixel = dst_size_in_pixel;
1905 1905
1906 std::unique_ptr<SkBitmap> bitmap(new SkBitmap); 1906 std::unique_ptr<SkBitmap> bitmap(new SkBitmap);
1907 if (!bitmap->tryAllocPixels(SkImageInfo::Make(output_size_in_pixel.width(), 1907 if (!bitmap->tryAllocPixels(SkImageInfo::Make(output_size_in_pixel.width(),
1908 output_size_in_pixel.height(), 1908 output_size_in_pixel.height(),
1909 color_type, 1909 color_type,
1910 kOpaque_SkAlphaType))) { 1910 kOpaque_SkAlphaType))) {
1911 scoped_callback_runner.Reset( 1911 scoped_callback_runner.ReplaceClosure(
1912 base::Bind(callback, SkBitmap(), READBACK_BITMAP_ALLOCATION_FAILURE)); 1912 base::Bind(callback, SkBitmap(), READBACK_BITMAP_ALLOCATION_FAILURE));
1913 return; 1913 return;
1914 } 1914 }
1915 1915
1916 std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock( 1916 std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock(
1917 new SkAutoLockPixels(*bitmap)); 1917 new SkAutoLockPixels(*bitmap));
1918 uint8_t* pixels = static_cast<uint8_t*>(bitmap->getPixels()); 1918 uint8_t* pixels = static_cast<uint8_t*>(bitmap->getPixels());
1919 1919
1920 ignore_result(scoped_callback_runner.Release()); 1920 ignore_result(scoped_callback_runner.Release());
1921 1921
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 case ui::MotionEvent::ACTION_UP: 1990 case ui::MotionEvent::ACTION_UP:
1991 case ui::MotionEvent::ACTION_POINTER_UP: 1991 case ui::MotionEvent::ACTION_POINTER_UP:
1992 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", 1992 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED",
1993 delta.InMicroseconds(), 1, 1000000, 50); 1993 delta.InMicroseconds(), 1, 1000000, 50);
1994 default: 1994 default:
1995 return; 1995 return;
1996 } 1996 }
1997 } 1997 }
1998 1998
1999 } // namespace content 1999 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/surface_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698