Skip to content

Commit 8a7603e

Browse files
committed
Document wpe_view_backend_dispatch_set_device_scale_factor()
1 parent 46480a1 commit 8a7603e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

include/wpe/view-backend.h

+23
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,29 @@ WPE_EXPORT
193193
void*
194194
wpe_view_backend_dispatch_get_accessible(struct wpe_view_backend* backend);
195195

196+
/**
197+
* wpe_view_backend_dispatch_set_device_scale_factor:
198+
* @view_backend: (transfer none): The view backend to configure.
199+
* @factor: Scaling factor to apply.
200+
*
201+
* Configure the device scaling factor applied to rendered content.
202+
*
203+
* Set the @factor by which sizes of content rendered to a web view will be
204+
* multiplied by. The typical reason to set a value other than `1.0` (the
205+
* default) is to produce output that will display at the intended physical
206+
* size in displays with a high density of pixels.
207+
*
208+
* Only values from `0.05` up to `5.0` are allowed. Setting a value outside
209+
* this range will be ignored, and in debug builds execution will be aborted.
210+
*
211+
* For example, a display that has a physical resolution of 3840x2160 with
212+
* a scaling factor of `2.0` will make web content behave as if the screen
213+
* had a size of 1920x1080, and content will be rendered at twice the size:
214+
* each “logical” pixel will occupy four “physical” pixels (a 2x2 box) on
215+
* the output.
216+
*
217+
* Since: 1.4
218+
*/
196219
WPE_EXPORT
197220
void
198221
wpe_view_backend_dispatch_set_device_scale_factor(struct wpe_view_backend*, float);

0 commit comments

Comments
 (0)