42 Commits

Author SHA1 Message Date
Siarhei Vishniakou
8027876f9f Refactor String8 to std::string calls
DisplayViewport::uniqueId is now std::string, so change the calls
appropriately. Do some additional cleanups and conversions.
This almost completely removes the dependency on String8.

Test: build only
Bug: 111108021
Change-Id: Ibbb6ca59e9061954d4a5fb930ef03d42cb0230db
2018-07-11 09:56:43 +01:00
Siarhei Vishniakou
bfd4914b60 Remove obsolete pragma statements
These pragma statements used to guard against compiler warnings in Sk..
code. They are no longer necessary.

Test: make
Change-Id: I9f7f88276edb546ba08c7344c142eb487a04f978
2018-02-23 15:48:10 -08:00
Ivan Lozano
7ee0dba095 Fix doFadingAnimationLocked in sanitized builds.
The loop as constructed causes i to overflow twice when i = 0 on integer
overflow sanitized builds.

 runtime error: unsigned integer overflow: 0 - 1 cannot be represented
 in type 'size_t' (aka 'unsigned long')

 runtime error: unsigned integer overflow: 18446744073709551615 + 1
 cannot be represented in type 'size_t' (aka 'unsigned long')

This refactors the loop to avoid the overflows.

Bug: 30969751
Test: Compiles, device boots, enabled pointer location overlay.
Change-Id: I844bb3b84b1f536c50d06fb489fcc22590d4aa98
2017-12-19 08:17:31 -08:00
Robert Carr
e13b58e15b Use new SurfaceFlinger transaction API.
For now we reimplement global transactions in the Java side
JNI layer.

Bug: 64815723
Bug: 64816140
Bug: 64815766
Test: Existing tests pass. go/wm-smoke
Change-Id: I6c0a7b5e65b1b6cc844ac61f3269629af60a4244
2017-10-09 16:52:48 -07:00
Derek Sollenberger
d938e5a2e2 Reduce overhead by combining libskia and libhwui into a single library.
This is a multiproject change as we need to both the libraries
themselves as well as those that had dependencies on libskia.so

Bug: 31971097
Test: compile only
Change-Id: Ie6ff1f4682d03289205f4d6048cde9f95c61a90f
2017-07-24 09:42:07 -04:00
Matt Sarett
155d52155b Remove uses of SkBitmap::copyTo
This API is being deleted:
skbug.com/6464

Test: Refactor

Change-Id: Id78653ca45d6bfee2e4f9c9c24c2414b888f0df5
2017-04-26 16:17:46 -04:00
Colin Cross
3fc8f2df30 Convert libinputservice to Android.bp
See build/soong/README.md for more information.

Test: m -j checkbuild
Change-Id: I3cd2bb05ec89c40ebd1240e352a19f99d00dc114
2017-04-19 17:39:21 -07:00
Mike Reed
6c9bb2408f Don't use deprecated canvas methods
Allows skia to remove SK_SUPPORT_LEGACY_CANVAS_HELPERS

Test: Existing tests cover the change.

Change-Id: I764c11f7a9bd7b87fba8563968160ee7dc9a99a2
2017-04-04 13:19:38 +00:00
Mathias Agopian
fee4a985fd fallout of libandroid.so split
Test: compiled & booted
Bug: 35164655
Change-Id: I786167a21453e17493969cdacfc9d31bdb781d98
2017-02-23 23:28:20 +00:00
Mark Salyzyn
db15537e6e resolve merge conflicts of 082a1721b516 to master
Test: compile
Bug: 26552300
Bug: 31289077
Change-Id: I17f178f425975c1c0dbd48091d25b101956d505e
2017-01-11 08:30:17 -08:00
Mark Salyzyn
52eb4e01a4 Replace cutils/log.h and log/logger.h with log/log.h
Test: compile
Bug: 26552300
Bug: 31289077
Change-Id: I578b15b48f0fc2807a92abbc69a377c3d2191496
2017-01-09 14:31:34 -08:00
Mike Reed
c2f31df8b3 use SkBlendMode
skbug.com/5814

Test: compile only
Change-Id: Ibbaff43df1117b2ca77fd8f917f03d88cc476330
(cherry picked from commit 26edbcba8a2ed4cb300e7f87e679e3b73cec2772)
2016-11-02 11:36:48 -04:00
Mike Reed
260ab72648 use SkBlendMode instead of SkXfermode
use sk_sp versions of paint setters/getters

Change-Id: I86591a0a8ec92e6039776cbf00424ea24f585b28
2016-10-13 17:14:52 -04:00
Vladislav Kaznacheev
bd46d09d84 Hold a weak reference to PointerController when handling vsync am: 33c5903e77 am: 8728a2fe53
am: 23bb30843c

Change-Id: Ifccc705f9b21fb8c24fd7fc83f99d9c58ac85b5c
2016-09-13 23:11:41 +00:00
Vladislav Kaznacheev
23bb30843c Hold a weak reference to PointerController when handling vsync am: 33c5903e77
am: 8728a2fe53

Change-Id: Id131b973188298718a6f5423373af5bf54c8b18f
2016-09-09 19:42:04 +00:00
Vladislav Kaznacheev
33c5903e77 Hold a weak reference to PointerController when handling vsync
Currently PointerController starts listening to display events
immediately (in its constructor) and never explicitly removes
the callback. The reference dangling from the looper
prevents the PointerController instance from being deleted
when all the clients have released their references.

As a result, when USB or BT mouse is disconnected,
the mouse stays frozen on screen and only goes away
after a 15 sec inactivity timeout.

This change introduces an intermediary LooperCallback
which holds only a weak reference to PointerController.
The pointer now disappears immediately upon mouse
disconnect.

Bug: 30824220
Change-Id: I5f7208dbfa381b3e21f248cc0da402f307faa184
2016-09-09 10:03:31 -07:00
Chih-hung Hsieh
e2a1cee3db Merge "Fix google-explicit-constructor warnings." am: a6b6252d8b am: 1676161c1d am: 316fa0aee7
am: 650615fb17

Change-Id: I0a37e6bd2c8e971c964dc5a4c4a6e6c228bce705
2016-09-01 18:02:04 +00:00
Chih-Hung Hsieh
6d09d547b0 Fix google-explicit-constructor warnings.
* Add explicit keyword to conversion constructors.
Bug: 28341362
Test: build with WITH_TIDY=1

Change-Id: Ic550902559b0800bdcfc0b1d301313a909434eed
2016-08-29 14:51:31 -07:00
Michael Wright
93b5f434a4 Remove Pointer Capture API
The underlying implementation needs to be completely rethought. If a
process crashed while you were in pointer capture mode, you were
pretty much stuck in it. If the mouse happened to move outside of
your bounds right before you called the API, you'd never actually get
an event (whatever it was hovering over would). There's no easy way
for the system to tell you when you enter or exit this mode because
it doesn't actually track who the current request is from.

These are all solvable, but not in the N time frame. Maybe next time.

Bug: 26830970
Change-Id: I899649594c7ca8db5962fcdaa71c5b21d3aa42c3
2016-06-08 20:13:53 +00:00
Michael Wright
e051f6f1fd Rename PointerIcon and Pointer Capture APIs
This is a response to API council feedback.

Bug: 26830970
Change-Id: I1be541a53e3943d06640169671824f7daea15462
2016-06-04 02:20:21 +01:00
Michael Wright
778e3b91ac DO NOT MERGE Remove Pointer Capture API
The underlying implementation needs to be completely rethought. If a
process crashed while you were in pointer capture mode, you were
pretty much stuck in it. If the mouse happened to move outside of
your bounds right before you called the API, you'd never actually get
an event (whatever it was hovering over would). There's no easy way
for the system to tell you when you enter or exit this mode because
it doesn't actually track who the current request is from.

These are all solvable, but not in the N time frame. Maybe next time.

Bug: 26830970
Change-Id: I03efd63c499b86dc278491ca3284566c1965581f
2016-05-17 18:02:37 +01:00
Michael Wright
f9d9ce7705 DO NOT MERGE Rename PointerIcon and Pointer Capture APIs
This is a response to API council feedback.

Bug: 26830970
Change-Id: Ia2d284b5c1ab8365bedfdc37d129be4b8146036b
2016-05-17 18:02:32 +01:00
Jun Mukai
347e5d498f Introduce pointer capture API.
This depends on I4189eb4d93f50c2865b7a325727be5ceebcc71f8 of
frameworks/native.

Bug: 5452473
Change-Id: Ie21e521f3e5c581f976dc0feb5d84bfa48b046cd
2015-12-18 10:22:43 -08:00
Jun Mukai
d4eaef7f4c Make public pointer icon API with custom icons.
BUG: 25778347, 23804184
Change-Id: If138b97c750c912e9848412c27b65004899961eb
2015-12-14 19:45:10 -08:00
Jun Mukai
19a5601979 Introduce accessibility large pointer icons.
This patch does the following things:
- add new graphic assets of large icons for accessibility needs
  (imported from ChromeOS data)
- add the logic to choose the set of normal icons or accessibility icons
- make InputManagerService to observe the settings change, so that
  it can reload the new resources

This patch misses non-1x graphic though, because ChromeOS doesn't
have such data.

Bug: 25778857
Change-Id: Ia5f95d47f50b3f6eea555c3af8069bc6bae0b400
2015-11-30 14:42:53 -08:00
Jun Mukai
808196f139 Introduce animated pointer icon for STYLE_WAIT.
Change-Id: I893f8276e09351db6187c553f349008794b95690
2015-11-17 17:36:08 -08:00
Jun Mukai
c0c0ac37ab Bring DisplayEventReceiver to PointerController.
Now the fading animation of pointers is handled at vsync.

Change-Id: I10fe27d9d7a0d46c4e6504ca487e80bb56e2fd98
2015-10-30 10:24:55 -07:00
Jun Mukai
5ec7420ecd Use invisible icon for POINTER_ICON_STYLE_NULL.
Change-Id: I10d35bdc4da4817d769eb164e6f15e4618670a05
2015-10-21 13:03:01 -07:00
Jun Mukai
1db5397d88 Allow changing mouse pointer icon for the current context.
Right now, it only supports I-beam on EditText, but further
rules will come in the future.

The png files for the icons are from chromium.

Bug: 24180385
Change-Id: I8de4ec8a5412b4830c08aa232c5083841c5c751c
2015-10-15 01:47:29 -07:00
Andreas Gampe
6b83b76dd1 Frameworks/base: Wall Werror in libs/input
Enable -Wall -Werror in libs/input. Mask warnings from Skia.

Change-Id: I0deeffde07fcf3a09eadec2852e9bf5666b55ee8
2014-11-10 15:55:11 -08:00
Riley Andrews
68eccdade2 Add cursor flags into SpriteController to suppor async cursor updates.
- This is fairly blindly taken from nvidia's implementation.

Change-Id: I825ecbd9cb4b394793dce079591b37efca546bbe
2014-07-28 22:04:06 +00:00
Mike Reed
4a9c3891d4 kNative_8888_SkColorType is now kN32_SkColorType
Change-Id: I13421a21de611203c62c1c1c36570a8cc803907b
2014-07-07 15:47:55 -04:00
Mike Reed
b933055cf3 stop using (deprecated) SkBitmap::Config
Change-Id: Ic75b5fc6996578e9d95bd3a220439ec1541d7c3b
2014-06-20 10:28:37 -04:00
Leon Scroggins
cc11f15f76 Update to call new Skia APIs.
I816129d49c0118453222916f3c818eccac33663d merges a new version of
Skia that updates various APIs. Call the new ones.

SkBitmap::copyTo now takes an SkColorType instead of an
SkBitmap::Config, so do the conversion with
SkBitmapConfigToColorType or use the enum when it makes sense.

Call SkImageDecoder::decodeSubset instead of (deprecated)
SkImageDecoder::decodeRegion.

Override SkCanvas::ClipVisitor::clipRRect in ClipCopier.

In Canvas::clip calls, call SkCanvas::isClipEmpty(), which was
previously called inside the clip call, to determine the return value.

For various SkPaint effects, call the new factories (as the constructors
have been made protected).

Implement SkJavaOutputStream::bytesWritten(), overriding a new pure
virtual function on SkWStream.

Update Matrix calls to always return true (since SkMatrix calls no
longer return a value).

Depends on I816129d49c0118453222916f3c818eccac33663d (skia).

Change-Id: I5cdcea827ebff587df0bbddc0965e3e0fbf48002
2014-04-04 14:42:39 -04:00
Derek Sollenberger
950fe8f8d4 Cleanup unnecessary includes for libskia.
The libskia target exports all of its public includes directories so
redefining them here is redundant. Also this cleans up and makes it
obvious where the framework is making using of private Skia headers.

Change-Id: Ie7ecc9ddd3df780bed6b9af54ba58ca58274e043
2014-02-27 16:21:24 +00:00
Michael Wright
d6b473713f Move inputservice over to frameworks/native
Remove all of the pieces except the PointerController and SpriteController over
to frameworks/native in preparation for inputflinger. Those two need to stay in
frameworks/base for now because they depend on Skia currently. In the long run
they should be merged into either the InputManager or the WindowManager rather
than as a part of the inputservice / inputflinger.

Try 2.

Change-Id: I84259356d3eb8efc5aefb9d6b311b5fc590ea3ed
2014-02-11 10:47:36 -08:00
Michael Wright
453fa30ab2 Revert "Move inputservice over to frameworks/native"
This reverts commit 89e5c7ebb37fabc4368e87e17a502db62598bd61.
2014-02-10 15:08:26 -08:00
Michael Wright
89e5c7ebb3 Move inputservice over to frameworks/native
Remove all of the pieces except the PointerController and SpriteController over
to frameworks/native in preparation for inputflinger. Those two need to stay in
frameworks/base for now because they depend on Skia currently. In the long run
they should be merged into either the InputManager or the WindowManager rather
than as a part of the inputservice / inputflinger.

Change-Id: Iebef71f3030fb3d26a5f338eb66d75bb37c17734
2014-02-10 14:10:27 -08:00
Michael Wright
a407d6a003 Remove SkRegion dependency from libinput
This gets us one step closer to removing our dependency on Skia, which is at
least one of the things blocking us from moving the input system out of
f/b.

Change-Id: I755e6267996c93fe700f1056327386923287575a
2014-02-10 12:59:34 -08:00
RoboErik
fb290df3c9 b/12068020 Make kb layouts only unique to vendor/product
Instead of storing a kb layout per device descriptor (which is expected
to be unique), store it for each vendor/product. This way we can keep
a consistent layout between identical but physically different keyboards.

There are some corner cases this is expected to fail on, namely devices
that incorrectly have the same vendor/product id. Devices that don't
define a vendor/product id will continue to use the descriptor to store
layout files.

Change-Id: Id0890d13e1c859eaf993d4831b7b1acbaf5df80f
2014-01-07 17:37:24 -08:00
Amith Yamasani
49782e46c0 am 9158825f: Move some system services to separate directories
* commit '9158825f9c41869689d6b1786d7c7aa8bdd524ce':
  Move some system services to separate directories
2013-12-19 23:30:35 +00:00
Amith Yamasani
9158825f9c Move some system services to separate directories
Refactored the directory structure so that services can be optionally
excluded. This is step 1. Will be followed by another change that makes
it possible to remove services from the build.

Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
2013-12-19 15:25:37 -08:00