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

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

Issue 1797663002: Fixes failing instrumentation tests on Nakasi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 } 896 }
897 897
898 if (!content_view_core_ || !(content_view_core_->GetWindowAndroid())) { 898 if (!content_view_core_ || !(content_view_core_->GetWindowAndroid())) {
899 callback.Run(SkBitmap(), READBACK_FAILED); 899 callback.Run(SkBitmap(), READBACK_FAILED);
900 return; 900 return;
901 } 901 }
902 ui::WindowAndroidCompositor* compositor = 902 ui::WindowAndroidCompositor* compositor =
903 content_view_core_->GetWindowAndroid()->GetCompositor(); 903 content_view_core_->GetWindowAndroid()->GetCompositor();
904 DCHECK(compositor); 904 DCHECK(compositor);
905 DCHECK(!surface_id_.is_null()); 905 DCHECK(!surface_id_.is_null());
906 compositor->AttachLayerForReadback(layer_);
no sievers 2016/03/16 00:16:12 Hmm that looks dangerous to attach the layer (pote
Jinsuk Kim 2016/03/16 06:03:12 Changed to the comment in the bug.
906 scoped_ptr<cc::CopyOutputRequest> request = 907 scoped_ptr<cc::CopyOutputRequest> request =
907 cc::CopyOutputRequest::CreateRequest( 908 cc::CopyOutputRequest::CreateRequest(
908 base::Bind(&PrepareTextureCopyOutputResult, 909 base::Bind(&PrepareTextureCopyOutputResult,
909 dst_size_in_pixel, preferred_color_type, start_time, 910 dst_size_in_pixel, preferred_color_type, start_time,
910 callback)); 911 layer_, callback));
911 if (!src_subrect_in_pixel.IsEmpty()) 912 if (!src_subrect_in_pixel.IsEmpty())
912 request->set_area(src_subrect_in_pixel); 913 request->set_area(src_subrect_in_pixel);
913 layer_->RequestCopyOfOutput(std::move(request)); 914 layer_->RequestCopyOfOutput(std::move(request));
914 } 915 }
915 916
916 void RenderWidgetHostViewAndroid::CopyFromCompositingSurfaceToVideoFrame( 917 void RenderWidgetHostViewAndroid::CopyFromCompositingSurfaceToVideoFrame(
917 const gfx::Rect& src_subrect, 918 const gfx::Rect& src_subrect,
918 const scoped_refptr<media::VideoFrame>& target, 919 const scoped_refptr<media::VideoFrame>& target,
919 const base::Callback<void(const gfx::Rect&, bool)>& callback) { 920 const base::Callback<void(const gfx::Rect&, bool)>& callback) {
920 NOTIMPLEMENTED(); 921 NOTIMPLEMENTED();
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1920 // TODO(wjmaclean): There is significant overlap between 1921 // TODO(wjmaclean): There is significant overlap between
1921 // PrepareTextureCopyOutputResult and CopyFromCompositingSurfaceFinished in 1922 // PrepareTextureCopyOutputResult and CopyFromCompositingSurfaceFinished in
1922 // this file, and the versions in surface_utils.cc. They should 1923 // this file, and the versions in surface_utils.cc. They should
1923 // be merged. See https://crbug.com/582955 1924 // be merged. See https://crbug.com/582955
1924 1925
1925 // static 1926 // static
1926 void RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult( 1927 void RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult(
1927 const gfx::Size& dst_size_in_pixel, 1928 const gfx::Size& dst_size_in_pixel,
1928 SkColorType color_type, 1929 SkColorType color_type,
1929 const base::TimeTicks& start_time, 1930 const base::TimeTicks& start_time,
1931 scoped_refptr<cc::Layer> layer,
1930 const ReadbackRequestCallback& callback, 1932 const ReadbackRequestCallback& callback,
1931 scoped_ptr<cc::CopyOutputResult> result) { 1933 scoped_ptr<cc::CopyOutputResult> result) {
1932 base::ScopedClosureRunner scoped_callback_runner( 1934 base::ScopedClosureRunner scoped_callback_runner(
1933 base::Bind(callback, SkBitmap(), READBACK_FAILED)); 1935 base::Bind(callback, SkBitmap(), READBACK_FAILED));
1934 TRACE_EVENT0("cc", 1936 TRACE_EVENT0("cc",
1935 "RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult"); 1937 "RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult");
1936 1938
1939 layer->RemoveFromParent();
1937 if (!result->HasTexture() || result->IsEmpty() || result->size().IsEmpty()) 1940 if (!result->HasTexture() || result->IsEmpty() || result->size().IsEmpty())
1938 return; 1941 return;
1939 1942
1940 gfx::Size output_size_in_pixel; 1943 gfx::Size output_size_in_pixel;
1941 if (dst_size_in_pixel.IsEmpty()) 1944 if (dst_size_in_pixel.IsEmpty())
1942 output_size_in_pixel = result->size(); 1945 output_size_in_pixel = result->size();
1943 else 1946 else
1944 output_size_in_pixel = dst_size_in_pixel; 1947 output_size_in_pixel = dst_size_in_pixel;
1945 1948
1946 GLHelper* gl_helper = GetPostReadbackGLHelper(); 1949 GLHelper* gl_helper = GetPostReadbackGLHelper();
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
2019 results->orientationAngle = display.RotationAsDegree(); 2022 results->orientationAngle = display.RotationAsDegree();
2020 results->orientationType = 2023 results->orientationType =
2021 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 2024 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
2022 gfx::DeviceDisplayInfo info; 2025 gfx::DeviceDisplayInfo info;
2023 results->depth = info.GetBitsPerPixel(); 2026 results->depth = info.GetBitsPerPixel();
2024 results->depthPerComponent = info.GetBitsPerComponent(); 2027 results->depthPerComponent = info.GetBitsPerComponent();
2025 results->isMonochrome = (results->depthPerComponent == 0); 2028 results->isMonochrome = (results->depthPerComponent == 0);
2026 } 2029 }
2027 2030
2028 } // namespace content 2031 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.h ('k') | ui/android/window_android_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698