summaryrefslogtreecommitdiff
path: root/ui
AgeCommit message (Collapse)Author
2020-06-05Fixing dependency problem for the mojo Range classDaniel Bratell
The mojo Range class needs range_struct_traits.h and the build system wasn't setup to allow that. Simplest for everyone is to integrate the struct_traits target into the mojom target and let the mojo system figure out dependencies. This made everything simpler. Without this fix you got errors like the one below: ERROR at //out/Default/gen/content/common/input/input_handler.mojom-test-utils.cc:49:11: Can't include this header from here. ^-------------------------------------- The target: //content/common:mojo_bindings is including a file from the target: //ui/gfx/range/mojo:struct_traits It's usually best to depend directly on the destination target. In some cases, the destination target is considered a subcomponent of an intermediate target. In this case, the intermediate target should depend publicly on the destination to forward the ability to include headers. Dependency chain (there may also be others): //content/common:mojo_bindings --> //services/ws/public/mojom/ime:ime --[private]--> //ui/gfx/range/mojo:struct_traits Bug: 938893 Change-Id: If01554d38ca3d5f4280d32c658d1f7044f14c29e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1536056 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org> Commit-Queue: Daniel Bratell <bratell@opera.com> Cr-Commit-Position: refs/heads/master@{#644390} CrOS-Libchrome-Original-Commit: 8e397e6338b7ed3bdf4f2c47412302e1c280a387
2020-06-05Fix geometry mojo build dependenciesDaniel Bratell
Everything using Rect in mojom files will indirectly need to include //ui/gfx/geometry/mojo/geometry_struct_traits.h" and for that to be allowed in gn, its build target (//ui/gfx/geometry/mojo:struct_traits) needs to be a public dependency. This fixes about 200 dependency errors as reported by a gn that can check dependencies in generated files (gn:57). Bug: 938893 Change-Id: Ifbe6d0c6a0bc26e158badf751322509e66093252 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1508467 Reviewed-by: Robert Sesek <rsesek@chromium.org> Commit-Queue: Daniel Bratell <bratell@opera.com> Cr-Commit-Position: refs/heads/master@{#638746} CrOS-Libchrome-Original-Commit: f89f75d95311695ae00ebda1f8be212259dee49c
2020-06-05test: Replace TYPED_TEST_CASE() with TYPED_TEST_SUITE().Victor Costan
Googletest is (at last) converging with industry-standard terminology [1]. We previously called test suites "test cases", which was rather confusing for folks coming from any other testing framework. Chrome now has a googletest version that supports TYPED_TEST_SUITE() macros instead of TYPED_TEST_CASE(), so this CL cleans up some of the outdated usage. [1] https://github.com/google/googletest/blob/master/googletest/docs/primer.md#beware-of-the-nomenclature TBR=blundell,jrummell,rockot,thakis Bug: 925652 Change-Id: I14930a3de8345e2c26b6420457b89dfc6a398820 Reviewed-on: https://chromium-review.googlesource.com/c/1475075 Reviewed-by: Victor Costan <pwnall@chromium.org> Reviewed-by: Darwin Huang <huangdarwin@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org> Auto-Submit: Victor Costan <pwnall@chromium.org> Cr-Commit-Position: refs/heads/master@{#632472} CrOS-Libchrome-Original-Commit: ebc5273392a38b5b5b94874d21bbd146b262774c
2020-06-05[ios] Enable iOS CoreGraphics conversions in gfx classesedchin
There was already code that allowed conversions in Mac OS X between CoreGraphics classes, such as CGRect, to gfx classes, such as Rect (and vice versa). This code was gated by #if defined(OS_MACOSX) but not defined(OS_IOS). This CL enables those conversions in iOS as well since CoreGraphics classes are used in iOS as well as MacOS. Change-Id: Idc1cbf9437fae74cb6cafe73abbecadbb9945575 Reviewed-on: https://chromium-review.googlesource.com/c/1424167 Reviewed-by: edchin <edchin@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Auto-Submit: edchin <edchin@chromium.org> Commit-Queue: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/master@{#624624} CrOS-Libchrome-Original-Commit: 8a796386c11afd362231d68d10fddea5fee4bb62
2020-06-05Fix AngleBetweenVectorsInDegrees NANbsheedy
Fixes potential NANs from gfx::AngleBetweenVectorsInDegrees and gfx::ClockwiseAngleBetweenVectorsInDegrees when the given vectors are very close together by clamping the value passed to acos. When unclamped, the value passed to acos could be slightly outside [-1, 1] due to floating point precision. Bug: 918734 Change-Id: I55b75b21581d25134fdc3e8e6db80892607a807c Reviewed-on: https://chromium-review.googlesource.com/c/1394086 Reviewed-by: Ian Vollick <vollick@chromium.org> Commit-Queue: Brian Sheedy <bsheedy@chromium.org> Cr-Commit-Position: refs/heads/master@{#619780} CrOS-Libchrome-Original-Commit: 4f2d56697612f4ffb9753b27d74c2dedf7451633
2020-06-05Use base::size rather than arraysize in ui/.Avi Drissman
This is purely a mechanical change; there is no intended behavior change. BUG=837308 TBR=thakis@chromium.org Change-Id: I0905add39f418f48c0c70b76db8cbc1cc91eefb7 Reviewed-on: https://chromium-review.googlesource.com/c/1390107 Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#618865} CrOS-Libchrome-Original-Commit: daf3af497a6265bc6db88539b528f92910fe03dd
2020-06-05Add setters to gfx::Insets for completeness.Dana Fried
Analogous to similar methods in Point and Size. These are used to simplify layout computation in a follow-up CL. Change-Id: If509de376cd1395f1d85aa5abe1121662e94629c Reviewed-on: https://chromium-review.googlesource.com/c/1351081 Commit-Queue: Dana Fried <dfried@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/master@{#611363} CrOS-Libchrome-Original-Commit: 98f045a4ad659194a996d9f0551bf3b82ba28ff0
2020-06-05[message_loop] Remove message_loop_forward.hAlexander Timin
As a final step, replace all includes back: - mv message_loop_current.h message_loop.h - s/message_loop_forward.h/message_loop.h/ in all includes. - s/message_loop_forward.h/message_loop.h/ in base/BUILD.gn - Remove message_loop_forward.h from third_party/DEPS. TBR=gab@chromium.org R=gab@chromium.org BUG=891670 Change-Id: I623077025701459ddb7045cbcfdad138aa90a9e4 Reviewed-on: https://chromium-review.googlesource.com/c/1313110 Reviewed-by: Alexander Timin <altimin@chromium.org> Reviewed-by: Gabriel Charette <gab@chromium.org> Cr-Commit-Position: refs/heads/master@{#604690} CrOS-Libchrome-Original-Commit: 4f9c35c3635144e2c2d1b87d09cbcf076d138b66
2020-06-05[message_loop] Temporary introduce message_loop_forward.h.Alexander Timin
To facilitate splitting MessageLoop into MessageLoop and MessageLoopImpl introduce message_loop_forward.h and use it everywhere. - s/message_loop.h/message_loop_forward.h/ in all includes. - Add message_loop_forward.h to base/BUILD.gn. - Add message_loop_forward.h to third_party/DEPS. TBR=gab@chromium.org BUG=891670 Change-Id: Ibac3a24f5bd4291c9d57dd32c627477e4e6ef324 Reviewed-on: https://chromium-review.googlesource.com/c/1313108 Reviewed-by: Gabriel Charette <gab@chromium.org> Commit-Queue: Gabriel Charette <gab@chromium.org> Cr-Commit-Position: refs/heads/master@{#604672} CrOS-Libchrome-Original-Commit: c643d0e146c996d39f757612b52ebea645561684
2020-06-05Give //ui/gfx:geometry:skia and ui/gfx/geometry their own export macrosdanakj
Since these are separate components, they should not be using the ui/gfx component's macros. R=thakis@chromium.org Change-Id: Icd90066e0dd8fb96c8ece4ed03f4a10e1bc40c27 Reviewed-on: https://chromium-review.googlesource.com/c/1259242 Commit-Queue: danakj <danakj@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Cr-Commit-Position: refs/heads/master@{#596751} CrOS-Libchrome-Original-Commit: f3e1d7f11ba69a7fe19f49115e4271943d36e25a
2020-06-05[PE] Ignore floating point error for clip rectsXianzhu Wang
A clip rect mapped through multiple transform spaces can be (1.99999, 2.00001, 10.999998, 20.000002). Previously we use ToEnclosingRect to convert it to an integral rect and will result a rect that has 1 pixel bigger in some directions, causing incorrect clipping result. Now add gfx::ToEnclosingIgnoringError to convert a near integral gfx::RectF to the nearest integral gfx::Rect. Bug: 879173 Cq-Include-Trybots: luci.chromium.try:linux-blink-gen-property-trees;luci.chromium.try:linux_layout_tests_slimming_paint_v2;luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel Change-Id: Id7ab68c04f8f1efed1dfe1810b82dd24d1a41ea5 Reviewed-on: https://chromium-review.googlesource.com/1252143 Reviewed-by: Ian Vollick <vollick@chromium.org> Reviewed-by: Ali Juma <ajuma@chromium.org> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/master@{#595947} CrOS-Libchrome-Original-Commit: 296fedf8021a31cf0afa3e07409a460c4512d99e
2020-06-05Rect utility functionsMitsuru Oshima
* left_center()/top_center()/right_center()/bottom center() return the center of each edge. * Transpose() swap x/y axis Bug: None Test: covered by unittests Change-Id: Icd63578dfe236caf6376c043fc1a0ffe74dfe6cc Reviewed-on: https://chromium-review.googlesource.com/1176861 Reviewed-by: Ian Vollick <vollick@chromium.org> Commit-Queue: Mitsuru Oshima (OOO) <oshima@chromium.org> Cr-Commit-Position: refs/heads/master@{#585065} CrOS-Libchrome-Original-Commit: 9bc77cd8ed2327ee31470e7483be20f58a350081
2020-06-05Fixed bug in gfx::Vector3dF for not setting zMax Rebuschatis
Bug: 875093 Change-Id: I7c2556c1a1ee64e77dc75bbe1562c22198050f56 Reviewed-on: https://chromium-review.googlesource.com/1179073 Commit-Queue: Max Rebuschatis <lincolnfrog@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/master@{#583931} CrOS-Libchrome-Original-Commit: 037f88a03973b12aeeded0ac80a541697930b479
2020-06-05Use mojo classes from ui/gfx/geometry in XRRay mojo typeMax Rebuschatis
Bug: 845293 Change-Id: Ic41d3ac4a1925d6e6c175d00b8ded71f85a6fedc Reviewed-on: https://chromium-review.googlesource.com/1089646 Commit-Queue: Max Rebuschatis <lincolnfrog@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Bill Orr <billorr@chromium.org> Cr-Commit-Position: refs/heads/master@{#583008} CrOS-Libchrome-Original-Commit: 61067e7ce39e17ea25c0faf314bc57979f7e066b
2020-06-05Add kalman_filter predictor input predictonElla Ge
This CL adds kalman filter predictor to input predicions The state transition model used in this model is: new_pos = pre_pos + v * dt + 1/2 * a * dt^2; new_v = v + a * dt; new_a = a; The resampling is still behind flag: kResampleInputEvents and kResampleScrollEvents, can be enabled by using field trial params 'predictor:kalman' with the flag. design doc: https://docs.google.com/document/d/1g6eGYdLZKznF3sCiktc5BbAPeiudWk8xTzx3qdrxowI/edit# Bug: 836352 Change-Id: Ib3a050203cbc463712e05faac0a25d5c98ca9c96 Reviewed-on: https://chromium-review.googlesource.com/1100000 Reviewed-by: danakj <danakj@chromium.org> Reviewed-by: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org> Commit-Queue: Ella Ge <eirage@chromium.org> Cr-Commit-Position: refs/heads/master@{#572625} CrOS-Libchrome-Original-Commit: db1af3539a8ba9cbe05256b37ef72d5098339775
2020-06-05Don't include Windows.h from range.hBruce Dawson
Including Windows.h causes namespace pollution and build-time costs due to the heavy use of macros and the large size of the headers. This removes a #include of Windows.h from range.h that is currently causing problems. Bug: 855717, 796644 Change-Id: I26abd068ed1c4a5ca65092258dd45ccd076c2b20 Reviewed-on: https://chromium-review.googlesource.com/1117739 Commit-Queue: Nico Weber <thakis@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: Robert Sesek <rsesek@chromium.org> Cr-Commit-Position: refs/heads/master@{#571155} CrOS-Libchrome-Original-Commit: 3c41dd4c6f6ab218366dbe4557910245e3f31bda
2020-06-05Add lsq predictor to input predictionElla Ge
This CL adds LSQ predictor to input prediction. LSQ predictor uses a quadratic least square regression model: y = b0 + b1 * x + b2 * x ^ 2. The resampling is still behind flag: kResampleInputEvents. design doc: https://docs.google.com/document/d/1DLfibi2NkV85p7AfEtNkvy24d283VRBSd3hz1Qh24Jw/edit# Bug: 836352 Change-Id: Ie1959c6b95152a80076debfb762c49d88a758af3 Reviewed-on: https://chromium-review.googlesource.com/1003220 Commit-Queue: Ella Ge <eirage@chromium.org> Reviewed-by: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org> Cr-Commit-Position: refs/heads/master@{#565035} CrOS-Libchrome-Original-Commit: a2089b42e91a143c74363885e1931fc447e74a42
2020-06-05base: Quaternion::ToSting() reports normal vector and theta.Dongseong Hwang
Chromium uses Quaternion for only rotation quaternion, so make it report rotation info. For the information, for the given rotation quaternion q, q = (con(abs(v_theta)/2), v_theta/abs(v_theta) * sin(abs(v_theta)/2)) Change-Id: I11c574d05c621078b3b9a15ad647e9ddfe501828 Reviewed-on: https://chromium-review.googlesource.com/920749 Commit-Queue: Dongseong Hwang <dongseong.hwang@intel.com> Reviewed-by: Dongseong Hwang <dongseong.hwang@intel.com> Reviewed-by: Ian Vollick <vollick@chromium.org> Cr-Commit-Position: refs/heads/master@{#553444} CrOS-Libchrome-Original-Commit: 9f0eda6387f9da0070fc4afc3deda0a1f34cebcc
2020-06-05Make ShadowValue usable as a constexpr.Peter Kasting
This makes sense since it's basically a bag of data. I didn't try hard to make every possible function constexpr. I thought this would be useful to me in making some ShadowValues, but since those are in a vector, which doesn't have a constexpr constructor, that doesn't work. Still, it may allow for some better-optimized code (didn't check), and for the (rare) case when you just have one ShadowValue to do something with. Also includes some other misc. cleanup I found at the same time. BUG=none TEST=none Change-Id: Ib492fe2cffb3ce68cb1c09b628d8f1376f046092 Reviewed-on: https://chromium-review.googlesource.com/923406 Commit-Queue: Peter Kasting <pkasting@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Cr-Commit-Position: refs/heads/master@{#538250} CrOS-Libchrome-Original-Commit: e91c195b4e4b86e89e950b993ea691c276aba981
2020-06-05Add gfx StructTraits for ScrollOffset.Dave Tapuska
To support synchronous compositor for Android webview over mojo add a struct trait for ScrollOffset BUG=722928 TBR=vollick@chromium.org Change-Id: I4138ac3ff93fc17e6a123335ac3a82975df48db4 Reviewed-on: https://chromium-review.googlesource.com/830115 Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/master@{#524713} CrOS-Libchrome-Original-Commit: ddd94b2599bf48df510823457dc50af88ea16ae2
2020-06-05Add vector Length function to QuaternionAnna Maria
Bug: 695937 Change-Id: I9355c99f508f61a3d72156c9bca6cbcb4ed18324 Reviewed-on: https://chromium-review.googlesource.com/812445 Reviewed-by: Ian Vollick <vollick@chromium.org> Commit-Queue: Anna Offenwanger <offenwanger@chromium.org> Cr-Commit-Position: refs/heads/master@{#522289} CrOS-Libchrome-Original-Commit: c9199d52c916658bec4674a41da856a675eb4945
2020-06-05Fix some nits in gfx::RectF.Lei Zhang
Change-Id: If0e083df1fbb883342faf9ba80e3cc8c606438ee Reviewed-on: https://chromium-review.googlesource.com/804205 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ian Vollick <vollick@chromium.org> Cr-Commit-Position: refs/heads/master@{#521609} CrOS-Libchrome-Original-Commit: 380025fc0e608129ad2591b64a39bcf43455a1a8
2020-06-05Separate tab icon and throbber into a separate view.Brett Wilson
This class handles the favicon, loading throbber, attention indicator, and sad tab animations. The separation makes the Tab class cleaner and allows this complex view to be re-used in the experimental tab class in the future. The network state enum was moved out from TabRendererData into its own class. It was updated to an enum class with new-style naming. Throbber stepping was moved to be entirely within the tab strip rather than round-tripping through the TabStripController. Change-Id: I063c0540e423ebbba3798a546ef58ef7616d629a Reviewed-on: https://chromium-review.googlesource.com/792451 Reviewed-by: Scott Violet <sky@chromium.org> Commit-Queue: Brett Wilson <brettw@chromium.org> Cr-Commit-Position: refs/heads/master@{#520759} CrOS-Libchrome-Original-Commit: 0e161fe557328950ff50f966b6c0dab2c7617f30
2020-06-05Draw profile chooser button with GTK when possibleTom Anderson
This is the initial implementation of drawing a native GTK button as the profile chooser button on Linux. There are still some tasks left (like fixing HIDPI rendering), so the feature is guarded behind an --enable-native-avatar-button flag. Demo: https://bugs.chromium.org/p/chromium/issues/detail?id=753067#c46 BUG=753067 Change-Id: Iff57d293a04bf2259aa0bb77161b51fec6370289 Reviewed-on: https://chromium-review.googlesource.com/703482 Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Elliot Glaysher <erg@chromium.org> Commit-Queue: Thomas Anderson <thomasanderson@chromium.org> Cr-Commit-Position: refs/heads/master@{#513338} CrOS-Libchrome-Original-Commit: 5a331d04305b0f804b1f9b356d935a73c5e905aa
2020-06-05Use mojo for page state serializationPatrick Noland
The goal of this change is to move page state serialization away from its custom format, which increases the complexity of migrating to new versions and fills the serialization code with unwieldy version checks. Add a mojom definition for PageState, FrameState and sub-entities thereof. Add functions that read from and write to the generated mojo structs. Serialize and deserialize PageState to/from the pickle using mojo's generated serialization code. Separate the existing serialization code into Legacy(Write|Read) functions. Expose legacy WritePageState implementation to tests. R=creis@chromium.org, dcheng@chromium.org Bug: Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation Change-Id: I331ab6f4593ad2cca9191043a7b9f9746e9423aa Reviewed-on: https://chromium-review.googlesource.com/647379 Commit-Queue: Patrick Noland <pnoland@google.com> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Charlie Reis <creis@chromium.org> Reviewed-by: Yuzhu Shen <yzshen@chromium.org> Reviewed-by: Ɓukasz Anforowicz <lukasza@chromium.org> Cr-Commit-Position: refs/heads/master@{#512366} CrOS-Libchrome-Original-Commit: 62b96a287e82191718cd64ac9ce6fc55d9aa993c
2020-06-05Fractional mouse event coordinates in ui/ashElla Ge
In this patch, we remove truncation in WebInputEvent builder. Use gfx::pointF in GetScreenLocation from ui::LocatedEvent to get fractional PositionInScreen. Add float coordinates conversions. Includes conversions in ui/ash part. (they are override functions of virtual function in screen_position_client.h) This CL doesn't expose the fractions to the web because of truncation in later stages in event pipeline. Bug: 456625 Change-Id: Ie1573cc8c059542f3fe07ce9c88b8c12c657ff96 Reviewed-on: https://chromium-review.googlesource.com/691338 Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org> Reviewed-by: Mustaq Ahmed <mustaq@chromium.org> Reviewed-by: Mitsuru Oshima <oshima@chromium.org> Commit-Queue: Ella Ge <eirage@chromium.org> Cr-Commit-Position: refs/heads/master@{#509988} CrOS-Libchrome-Original-Commit: 7540c84b788cf1bdff2ad3b53f893774659405f1
2020-06-05Revert "[cc] Split TransformNode members into input values and derived values"Thiemo Nagel
This reverts commit ce3e2fd8496123a0737dcee3dd1d44bccbf36456. Reason for revert: Speculative revert. This CL is in the regression range [1] for WebKit layout failure in css3/blending/background-blend-mode-overlapping-accelerated-elements.html [2] and it updates Win7 expectations without updating Win10 expectations which makes it a likely culprit to my mind. [1] https://chromium.googlesource.com/chromium/src/+log/4d62f13f73427a9c9881fe3249ceeebbe2226d4b%5E..a20785d5c280afeaa21aead507fa6c16f905eba8?pretty=fuller&n= [2] https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win10/builds/26322 Original change's description: > [cc] Split TransformNode members into input values and derived values > > This cleanup CL refactors TransformNode structure so that its member > variables are splitted into input values and derived values, so that it > is clearer which values are expected to be set by the client and which > are to be recalculated by impl thread every frame. > > In the process, pre_local and post_local are eliminated and is only > computed on the fly. To achieve this, the calculation of post_local > needs to be unified between root and non-root layers. Previously the > transform node #0 stores the scale component of the root transform[1], > and node #1 stores the root transform with scale component extracted. > > With this CL, transform node #0 stores the whole root transform and > node #1 becomes a regular node. > > This CL affects rounding error of draw matrices due to the change in > association order. Should introduce no other behavior change. > > [1] root transform = device_transform * device_scale * page_scale > > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > Change-Id: Ia553ec5816d71eff6e2d7bc42b51b439817d9d2b > Reviewed-on: https://chromium-review.googlesource.com/685544 > Reviewed-by: Chris Harrelson <chrishtr@chromium.org> > Reviewed-by: danakj <danakj@chromium.org> > Reviewed-by: Ali Juma <ajuma@chromium.org> > Commit-Queue: Tien-Ren Chen <trchen@chromium.org> > Cr-Commit-Position: refs/heads/master@{#506901} TBR=danakj@chromium.org,ajuma@chromium.org,trchen@chromium.org,chrishtr@chromium.org Change-Id: I861b7f6ac3911d872aa2c98a4c4e4a1e0b603411 No-Presubmit: true No-Tree-Checks: true No-Try: true Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Reviewed-on: https://chromium-review.googlesource.com/704855 Reviewed-by: Thiemo Nagel <tnagel@chromium.org> Commit-Queue: Thiemo Nagel <tnagel@chromium.org> Cr-Commit-Position: refs/heads/master@{#507033} CrOS-Libchrome-Original-Commit: 326859caa87667c2c244d1253f57506f13ef7a51
2020-06-05[cc] Split TransformNode members into input values and derived valuesTien-Ren Chen
This cleanup CL refactors TransformNode structure so that its member variables are splitted into input values and derived values, so that it is clearer which values are expected to be set by the client and which are to be recalculated by impl thread every frame. In the process, pre_local and post_local are eliminated and is only computed on the fly. To achieve this, the calculation of post_local needs to be unified between root and non-root layers. Previously the transform node #0 stores the scale component of the root transform[1], and node #1 stores the root transform with scale component extracted. With this CL, transform node #0 stores the whole root transform and node #1 becomes a regular node. This CL affects rounding error of draw matrices due to the change in association order. Should introduce no other behavior change. [1] root transform = device_transform * device_scale * page_scale Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: Ia553ec5816d71eff6e2d7bc42b51b439817d9d2b Reviewed-on: https://chromium-review.googlesource.com/685544 Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Reviewed-by: Ali Juma <ajuma@chromium.org> Commit-Queue: Tien-Ren Chen <trchen@chromium.org> Cr-Commit-Position: refs/heads/master@{#506901} CrOS-Libchrome-Original-Commit: ce3e2fd8496123a0737dcee3dd1d44bccbf36456
2020-06-05Move deg<->rad conversions from cc to ui/gfx/geometry and use them more.Peter Kasting
This also aims to eliminate _USE_MATH_DEFINES entirely by removing the last vestiges of M_PI (at least, from the directories that can depend on ui/gfx). Bug: none Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel Change-Id: Iae16aa804aeb80a750af34b457d426b92dd6c302 Reviewed-on: https://chromium-review.googlesource.com/657905 Reviewed-by: Tim Volodine <timvolodine@chromium.org> Reviewed-by: Dirk Pranke <dpranke@chromium.org> Reviewed-by: Timothy Dresser <tdresser@chromium.org> Reviewed-by: James Cook <jamescook@chromium.org> Reviewed-by: Rohit Rao (ping after 24h) <rohitrao@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org> Reviewed-by: Ian Vollick <vollick@chromium.org> Commit-Queue: Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/master@{#503069} CrOS-Libchrome-Original-Commit: f9f3cebe6abf575ef8bda227a7dee4faa6cd312b
2020-06-05Move constants for pi from cc to base and use them more widely.Peter Kasting
Bug: none Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I440e0a3f09839a3b69db243737ba4ff4e90288c8 Reviewed-on: https://chromium-review.googlesource.com/658604 Commit-Queue: Peter Kasting <pkasting@chromium.org> Reviewed-by: Min Qin <qinmin@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Reviewed-by: Fredrik Hubinette <hubbe@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Simon Que <sque@chromium.org> Reviewed-by: Timothy Dresser <tdresser@chromium.org> Reviewed-by: Mark Cogan <marq@chromium.org> Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org> Reviewed-by: Yuwei Huang <yuweih@chromium.org> Reviewed-by: Rebekah Potter <rbpotter@chromium.org> Reviewed-by: Ian Vollick <vollick@chromium.org> Cr-Commit-Position: refs/heads/master@{#501901} CrOS-Libchrome-Original-Commit: 76ed066d302d647ccfc0420c78551498011c3d3f
2020-06-05Implements core logic for Pixel Canvasmalaykeshav
This patch implements the core logic for Pixel Canvas while hiding it behind a compositor switch (Disabled by default). Pixel Canvas enables all canvas draw commands to be recorded at pixel size, helping eliminate a majority of fractional device scale factor bugs. This also allows devices to work at all non discrete fractional scales with reduced(or no) overhead. Subsequent changes will fix bugs that happen when this mode is enabled. This is to avoid one massive CL. DesignDoc=go/pixel-canvas Slides=go/pixel-canvas-slide BUG=720596 COMPONENT=Canvas, View, Layer, Paint Context, Paint Recorder CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2877483003 Cr-Commit-Position: refs/heads/master@{#491587} CrOS-Libchrome-Original-Commit: 55c9f6d21086e418dac45a58e5f51a3a5ef7bc1e
2020-06-05Replace Saturated*() calls with Clamp*() templatesJustin Schuh
This replaces the calls but leaves the saturated_arithmetic headers where they are. Those will be moved in the next CL. This is a reland of 191d11489cb9f83e1e1575a29abf3904e7efa87b TBR=eae@chromium.org Bug: 672489 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I8e88f30fe3d22db3cac5bfcf13e83fc8dbaff870 Reviewed-on: https://chromium-review.googlesource.com/576137 Commit-Queue: Justin Schuh <jschuh@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Reviewed-by: Justin Schuh <jschuh@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#488966} CrOS-Libchrome-Original-Commit: 4a572da99ce704e632221bd05e6d894d49a73dcc
2020-06-05Revert "Replace Saturated*() calls with Clamp*() templates"Justin Schuh
This reverts commit c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36. Reason for revert: failure on Google Chrome Linux x64 https://build.chromium.org/p/chromium.chrome/buildstatus?builder=Google%20Chrome%20Linux%20x64&number=19288 Original change's description: > Replace Saturated*() calls with Clamp*() templates > > This replaces the calls but leaves the saturated_arithmetic headers > where they are. Those will be moved in the next CL. > This is a reland of 191d11489cb9f83e1e1575a29abf3904e7efa87b > > TBR=eae@chromium.org > > Bug: 672489 > Change-Id: I7efb5025ace03b3fc8ff8b698a456162b27ee2a7 > Reviewed-on: https://chromium-review.googlesource.com/572145 > Commit-Queue: Justin Schuh <jschuh@chromium.org> > Reviewed-by: Justin Schuh <jschuh@chromium.org> > Cr-Commit-Position: refs/heads/master@{#487393} TBR=jschuh@chromium.org,eae@chromium.org Change-Id: Ie9432e293f7d1f9670209d1e8223c0632ff63105 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 672489 Reviewed-on: https://chromium-review.googlesource.com/575852 Reviewed-by: Justin Schuh <jschuh@chromium.org> Commit-Queue: Justin Schuh <jschuh@chromium.org> Cr-Commit-Position: refs/heads/master@{#487398} CrOS-Libchrome-Original-Commit: 5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea
2020-06-05Replace Saturated*() calls with Clamp*() templatesJustin Schuh
This replaces the calls but leaves the saturated_arithmetic headers where they are. Those will be moved in the next CL. This is a reland of 191d11489cb9f83e1e1575a29abf3904e7efa87b TBR=eae@chromium.org Bug: 672489 Change-Id: I7efb5025ace03b3fc8ff8b698a456162b27ee2a7 Reviewed-on: https://chromium-review.googlesource.com/572145 Commit-Queue: Justin Schuh <jschuh@chromium.org> Reviewed-by: Justin Schuh <jschuh@chromium.org> Cr-Commit-Position: refs/heads/master@{#487393} CrOS-Libchrome-Original-Commit: c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36
2020-06-05Revert "Replace Saturated*() calls with Clamp*() templates"Justin Schuh
This reverts commit 191d11489cb9f83e1e1575a29abf3904e7efa87b. Reason for revert: NaCl broke on the Linux x64 builder Original change's description: > Replace Saturated*() calls with Clamp*() templates > > This replaces the calls but leaves the saturated_arithmetic headers > where they are. Those will be moved in the next CL. > > Bug: 672489 > Change-Id: If901e49240b2e8d1f85155b9b395d9bb584300cf > Reviewed-on: https://chromium-review.googlesource.com/571317 > Commit-Queue: Justin Schuh <jschuh@chromium.org> > Reviewed-by: Emil A Eklund <eae@chromium.org> > Cr-Commit-Position: refs/heads/master@{#486905} TBR=danakj@chromium.org,jschuh@chromium.org,eae@chromium.org Change-Id: I6515c4ffa226fe39027c91f77d42051f2638686e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 672489 Reviewed-on: https://chromium-review.googlesource.com/572307 Reviewed-by: Justin Schuh <jschuh@chromium.org> Commit-Queue: Justin Schuh <jschuh@chromium.org> Cr-Commit-Position: refs/heads/master@{#486916} CrOS-Libchrome-Original-Commit: b1573039b77716775b1309715ef8c9d3b34eef70
2020-06-05Replace Saturated*() calls with Clamp*() templatesJustin Schuh
This replaces the calls but leaves the saturated_arithmetic headers where they are. Those will be moved in the next CL. Bug: 672489 Change-Id: If901e49240b2e8d1f85155b9b395d9bb584300cf Reviewed-on: https://chromium-review.googlesource.com/571317 Commit-Queue: Justin Schuh <jschuh@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#486905} CrOS-Libchrome-Original-Commit: 191d11489cb9f83e1e1575a29abf3904e7efa87b
2020-06-05Fix matrix interpolation between rotations of 180 degreesvollick
In a previous cl (https://chromium-review.googlesource.com/526993), I intentionally avoided interpolating decomposed rotation components if they differed by 180 degrees (because this was ambiguous). This does not match the spec (https://www.w3.org/TR/css-transforms-1/#interpolation-of-decomposed-3d-matrix-values) This change reverts us to the previous rotation behavior. BUG=739723 Review-Url: https://codereview.chromium.org/2971903005 Cr-Commit-Position: refs/heads/master@{#484678} CrOS-Libchrome-Original-Commit: 799b4a3caeaaa5b99fea35d3ce3a96f7553b8f56
2020-06-05Convert ElbowModel to gfx typesIan Vollick
This is one step in the migration away from vr types. I've also introduced some vr <-> gfx conversion routines in vr_math to ease the transition. Bug: 718004 Change-Id: I1bc686f2a9794c46ff4422b4bcea78861678dc39 Reviewed-on: https://chromium-review.googlesource.com/535793 Commit-Queue: Ian Vollick <vollick@chromium.org> Reviewed-by: Michael Thiessen <mthiesse@chromium.org> Cr-Commit-Position: refs/heads/master@{#479426} CrOS-Libchrome-Original-Commit: a25066c9a379ed1ed98830c504986ea2e2363b1b
2020-06-05Add Vector3dF::GetNormalizedIan Vollick
This is a common operation that can fail if the vector is too short. Bug: 718004 Change-Id: I8b379249e3d4b2bc8c500d756899064d8fbb74a5 Reviewed-on: https://chromium-review.googlesource.com/535113 Commit-Queue: Ian Vollick <vollick@chromium.org> Reviewed-by: Yash Malik <ymalik@chromium.org> Cr-Commit-Position: refs/heads/master@{#479278} CrOS-Libchrome-Original-Commit: bed672a16779591caaaa3f9f3f1814dbfc48fc16
2020-06-05Add a Quaternion ctor that represents a rotation between Vector3dFsIan Vollick
Bug: None Change-Id: Iaffa31a55019b3bf25cac048eb81cc9bb05cc950 Reviewed-on: https://chromium-review.googlesource.com/530105 Commit-Queue: Ian Vollick <vollick@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Reviewed-by: Michael Thiessen <mthiesse@chromium.org> Cr-Commit-Position: refs/heads/master@{#478691} CrOS-Libchrome-Original-Commit: eb7d9cff12b8e8d49653a17e69776fa6bc508613
2020-06-05Quaternion::Lerp should return a normalized valueIan Vollick
This was missed in the patch that introduced the Quaternion. Unittests have been updated to reflect the change (and I've made a minor refactor to avoid so many component-wise comparisons). Bug: 718004 Change-Id: Ife5618aadf33c9908ffa13e3ffabad9ae419fa3e Reviewed-on: https://chromium-review.googlesource.com/530325 Reviewed-by: Michael Thiessen <mthiesse@chromium.org> Commit-Queue: Ian Vollick <vollick@chromium.org> Cr-Commit-Position: refs/heads/master@{#478634} CrOS-Libchrome-Original-Commit: d2c30bb5110a526dc260951ae6e78b6d151f595a
2020-06-05Introduce QuaternionIan Vollick
The quaternion code existed, but was hidden away in transform utils. This change exposes it and allows it to be reused elsewhere. TBR=sadrul@chromium.org Bug: None Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel Change-Id: I8d62db79e8a228864fd82a8cba4086b1caeb820f Reviewed-on: https://chromium-review.googlesource.com/526993 Commit-Queue: Ian Vollick <vollick@chromium.org> Reviewed-by: Michael Thiessen <mthiesse@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/master@{#478044} CrOS-Libchrome-Original-Commit: 4d40fcb91bc157f095b8c0a01302a6c6e2d28817
2020-06-05Mojo C++ Bindings: Eliminate CreateInterfacePtrAndBindKen Rockot
These methods are redundant with MakeRequest and whatever binding interface is supported by different types of binding primitives (e.g. Binding, BindingSet, etc.) BUG=721507 TBR=tsepez@chromium.org Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_site_isolation;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I4eb2a98c5bb7d4854319f2621fbf332db4941dae Reviewed-on: https://chromium-review.googlesource.com/527297 Commit-Queue: Ken Rockot <rockot@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org> Reviewed-by: John Abd-El-Malek <jam@chromium.org> Cr-Commit-Position: refs/heads/master@{#477766} CrOS-Libchrome-Original-Commit: 1caed9e9b41dfa2485d899edde6aacc64c907c9f
2020-06-05Use OnceCallback on Mojo interfaces in //ui/gfxtzik
This CL flips `use_once_callback` flag on the Mojo code generator, and fixes all compile errors after it. After this CL, Mojo interfaces in //ui/gfx starts using base::OnceCallback instead of base::Callback on its return value handling. The migration recipe was: - Convert pass-by-ref callback objects to pass-by-value. - Use std::move() to forward it to other consumer, or to invoke it with Callback::Run(). - Handle wherever copies are required manually. - Check if the conversion doesn't change the semantics. As the transfer and invocation clobber the callback object, care about use-after-move. It's considered safe to consume almost scoped-out callback. Bug: 714018 Change-Id: Ibce19bc30b96b3eadf0e9c22ae2e2895aec87d1f Reviewed-on: https://chromium-review.googlesource.com/522209 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Commit-Queue: Taiju Tsuiki <tzik@chromium.org> Cr-Commit-Position: refs/heads/master@{#477632} CrOS-Libchrome-Original-Commit: 08ec0ff5c352c9ab52ced3a6b44f0796530fc4a2
2020-06-05[3/5] Add translated rasterization support for RasterBuffer & belowtrchen
This CL implements the muscle of transformed rasterization. RasterBuffer now accepts a translation in addition to a scale factor when rasterizing into a backing. Arbitrary raster transformation is not planned for near future. Thus only implementing scale & translate which already helps many common cases. CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2563743004 Cr-Commit-Position: refs/heads/master@{#461673} CrOS-Libchrome-Original-Commit: 178ac91a501f976d584a845962fc1afd8a927362
2020-06-05Handle large rects better.petermayo
Handling rects that are essentially infinite in one or two directions is not symmetric because we use an assymetric representation for many. We have to be careful not to overflow our representation(s) around these to keep as much meaningful state as possible. BUG=None CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2744423002 Cr-Commit-Position: refs/heads/master@{#460848} CrOS-Libchrome-Original-Commit: 9711f036f202f53ae0bfa6bb6195c3e61ecae274
2020-06-05Stabilize empty rect handling in EnclosingRect.petermayo
We want empty Rects to have empty enclosing rects, per https://chromiumcodereview.appspot.com/15233003, but we would prefer this to not bounce around based on floating point calculations accumulating some epsilon sized errors. roundOut in SKIA does not have either the former or the new behavior, so we are drifting apart from an underlying expectation, and should be careful this doesn't cause future inconsistencies between paths, like mainthread/ impl thread. BUG=None R=danakj CC=sky CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2749513011 Cr-Commit-Position: refs/heads/master@{#460794} CrOS-Libchrome-Original-Commit: faa28efcb640abddbf5f80a75724bad3d6e20a31
2020-06-05Make much of gfx::Range[F] constexpr.pkasting
Range is a simply class that contains a pair of values, and it's useful for tests to have constexpr objects of Range type. BUG=none TEST=none Review-Url: https://codereview.chromium.org/2734663002 Cr-Commit-Position: refs/heads/master@{#455260} CrOS-Libchrome-Original-Commit: ad5e4c8145e3b79a8fc395f46b1371dabb62a01b
2020-06-05Added additional logging to flaky test "LoginGuestTest.CursorShown"bruthig
BUG=693106 TEST=interactive_ui_browsertests Review-Url: https://codereview.chromium.org/2689283010 Cr-Commit-Position: refs/heads/master@{#451379} CrOS-Libchrome-Original-Commit: 18e708a65aceef17a02b4aad341015be24606141
2020-06-05Struct traits for gfx::Range and gfx::RangeF.moshayedi
This can be useful for serializing/deserializing ui::CompositionText, etc. BUG=NONE Review-Url: https://codereview.chromium.org/2531323002 Cr-Commit-Position: refs/heads/master@{#435056} CrOS-Libchrome-Original-Commit: 0c9234448950979bb56ec999d1a0773c819326d0