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

Side by Side Diff: content/shell/test_runner/pixel_dump.h

Issue 2963593002: Split DumpPixelsAsync in pixel_dump.h into more granular functions. (Closed)
Patch Set: . Created 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef CONTENT_SHELL_TEST_RUNNER_PIXEL_DUMP_H_ 5 #ifndef CONTENT_SHELL_TEST_RUNNER_PIXEL_DUMP_H_
6 #define CONTENT_SHELL_TEST_RUNNER_PIXEL_DUMP_H_ 6 #define CONTENT_SHELL_TEST_RUNNER_PIXEL_DUMP_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "content/shell/test_runner/test_runner_export.h"
10 9
11 class SkBitmap; 10 class SkBitmap;
12 11
13 namespace blink { 12 namespace blink {
14 class WebView; 13 class WebLocalFrame;
15 } // namespace blink 14 } // namespace blink
16 15
17 namespace test_runner { 16 namespace test_runner {
18 17
19 class LayoutTestRuntimeFlags; 18 // Asks |web_frame|'s widget to dumps its pixels and calls |callback| with the
alexmos 2017/07/11 15:01:06 nit: s/dumps/dump/
Łukasz Anforowicz 2017/07/11 16:30:24 Done.
19 // result.
20 void DumpPixelsAsync(blink::WebLocalFrame* web_frame,
21 float device_scale_factor_for_test,
22 base::OnceCallback<void(const SkBitmap&)> callback);
20 23
21 // Dumps image snapshot of |web_view|. Exact dump mode depends on |flags| (i.e. 24 // Asks |web_frame| to print itself and calls |callback| with the result.
22 // dump_selection_rect and/or is_printing). Caller needs to ensure that 25 void PrintFrameAsync(blink::WebLocalFrame* web_frame,
23 // |layout_test_runtime_flags| stays alive until |callback| gets called. 26 base::OnceCallback<void(const SkBitmap&)> callback);
24 TEST_RUNNER_EXPORT void DumpPixelsAsync(
25 blink::WebView* web_view,
26 const LayoutTestRuntimeFlags& layout_test_runtime_flags,
27 float device_scale_factor_for_test,
28 const base::Callback<void(const SkBitmap&)>& callback);
29 27
30 // Copy to clipboard the image present at |x|, |y| coordinates in |web_view| 28 // Creates a new callback that will first draw the current selection rect of
alexmos 2017/07/11 15:01:06 This is called "selection bounds rect" elsewhere,
Łukasz Anforowicz 2017/07/11 16:30:23 Done (I also named the parameters of the callbacks
29 // |web_frame| and *then* call the |original_callback|.
30 base::OnceCallback<void(const SkBitmap&)> CreateSelectionDrawingCallback(
alexmos 2017/07/11 15:01:06 The name sounds like it draws the selection rather
Łukasz Anforowicz 2017/07/11 16:30:24 Done.
31 blink::WebLocalFrame* web_frame,
32 base::OnceCallback<void(const SkBitmap&)> original_callback);
33
34 // Copy to clipboard the image present at |x|, |y| coordinates in |web_frame|
31 // and pass the captured image to |callback|. 35 // and pass the captured image to |callback|.
32 void CopyImageAtAndCapturePixels( 36 void CopyImageAtAndCapturePixels(
33 blink::WebView* web_view, 37 blink::WebLocalFrame* web_frame,
34 int x, 38 int x,
35 int y, 39 int y,
36 const base::Callback<void(const SkBitmap&)>& callback); 40 base::OnceCallback<void(const SkBitmap&)> callback);
37 41
38 } // namespace test_runner 42 } // namespace test_runner
39 43
40 #endif // CONTENT_SHELL_TEST_RUNNER_PIXEL_DUMP_H_ 44 #endif // CONTENT_SHELL_TEST_RUNNER_PIXEL_DUMP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698