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

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

Issue 1635513003: Implement webview.captureVisibleRegion() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Save bug number to surface_utils.cc. Created 4 years, 10 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 #include <utility> 8 #include <utility>
9 9
10 #include "base/android/build_info.h" 10 #include "base/android/build_info.h"
(...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 SkColorType color_type, 1959 SkColorType color_type,
1960 const base::TimeTicks& start_time, 1960 const base::TimeTicks& start_time,
1961 scoped_refptr<cc::Layer> readback_layer, 1961 scoped_refptr<cc::Layer> readback_layer,
1962 const ReadbackRequestCallback& callback, 1962 const ReadbackRequestCallback& callback,
1963 scoped_ptr<cc::CopyOutputResult> result) { 1963 scoped_ptr<cc::CopyOutputResult> result) {
1964 readback_layer->RemoveFromParent(); 1964 readback_layer->RemoveFromParent();
1965 PrepareTextureCopyOutputResult(dst_size_in_pixel, color_type, start_time, 1965 PrepareTextureCopyOutputResult(dst_size_in_pixel, color_type, start_time,
1966 callback, std::move(result)); 1966 callback, std::move(result));
1967 } 1967 }
1968 1968
1969 // TODO(wjmaclean): There is significant overlap between
1970 // PrepareTextureCopyOutputResult and CopyFromCompositingSurfaceFinished in
1971 // this file, and the versions in surface_utils.cc. They should
1972 // be merged. See https://crbug.com/582955
1973
1969 // static 1974 // static
1970 void RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult( 1975 void RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult(
1971 const gfx::Size& dst_size_in_pixel, 1976 const gfx::Size& dst_size_in_pixel,
1972 SkColorType color_type, 1977 SkColorType color_type,
1973 const base::TimeTicks& start_time, 1978 const base::TimeTicks& start_time,
1974 const ReadbackRequestCallback& callback, 1979 const ReadbackRequestCallback& callback,
1975 scoped_ptr<cc::CopyOutputResult> result) { 1980 scoped_ptr<cc::CopyOutputResult> result) {
1976 base::ScopedClosureRunner scoped_callback_runner( 1981 base::ScopedClosureRunner scoped_callback_runner(
1977 base::Bind(callback, SkBitmap(), READBACK_FAILED)); 1982 base::Bind(callback, SkBitmap(), READBACK_FAILED));
1978 TRACE_EVENT0("cc", 1983 TRACE_EVENT0("cc",
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
2063 results->orientationAngle = display.RotationAsDegree(); 2068 results->orientationAngle = display.RotationAsDegree();
2064 results->orientationType = 2069 results->orientationType =
2065 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 2070 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
2066 gfx::DeviceDisplayInfo info; 2071 gfx::DeviceDisplayInfo info;
2067 results->depth = info.GetBitsPerPixel(); 2072 results->depth = info.GetBitsPerPixel();
2068 results->depthPerComponent = info.GetBitsPerComponent(); 2073 results->depthPerComponent = info.GetBitsPerComponent();
2069 results->isMonochrome = (results->depthPerComponent == 0); 2074 results->isMonochrome = (results->depthPerComponent == 0);
2070 } 2075 }
2071 2076
2072 } // namespace content 2077 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_widget_host_view_guest.cc ('k') | extensions/browser/api/capture_web_contents_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698