35 Commits

Author SHA1 Message Date
Derek Sollenberger
79abbf22d4 Update HWUI tests to use minikin to layout fonts.
This update is a precondition for landing additional tests
that depend on the minkin layout implementation.

bug: 27675371
Change-Id: I9bb98bae6b39462246e42cf8acb968b7df05292d
2016-03-25 11:53:08 -04:00
sergeyv
dccca44ffd Reland: Move text logic from jni to hwui level
Initial CL: https://googleplex-android-review.git.corp.google.com/#/c/886854/

Change-Id: I9dfd85fe1d2a2c44f4360c8a29fd58d80e6f31c8
2016-03-21 15:55:46 -07:00
Sergei Vasilinetc
afbd0f1fef Revert "Move text logic from jni to hwui level"
This reverts commit a7f6bba1a3565c19715e878dfe7f0e01022944ff.

Change-Id: If4f36f87a85411b6128fd92d391313803ccaf9dd
2016-03-21 21:03:40 +00:00
sergeyv
a7f6bba1a3 Move text logic from jni to hwui level
bug:25865834
Change-Id: I2d8c9c9544afcb5ce1784f732aed3e54e0eda372
2016-03-17 09:48:57 -07:00
Doris Liu
766431aa57 Revert "Revert "VectorDrawable native rendering - Step 4 of MANY""
This reverts commit 5a11e8d0ba21624025b89ac63bbd18befa55be0e.

Change-Id: I7a48b59c4f930dad65ddc8590c25a12636244ea2
2016-02-04 16:29:51 -08:00
Doris Liu
5a11e8d0ba Revert "VectorDrawable native rendering - Step 4 of MANY"
b/26949340 and b/26975469, b/26975079 as well 

This reverts commit f276acd98457bcaabc9e79a17a736b3b484f005e.

Change-Id: I4b55177daf0d289bc03604c71fd4bf579f65073a
2016-02-04 20:59:00 +00:00
Derek Sollenberger
6f485569fa Update Canvas API with view system calls.
Refactor DisplayListCanvas, RecordingCanvas, and SkiaCanvas
to share a common API.

Change-Id: I0268ec2749ea5d13a3a72bb2784ed6a9911383d9
2016-02-03 09:13:04 -05:00
Doris Liu
f276acd984 VectorDrawable native rendering - Step 4 of MANY
This CL runs VectorDrawable animation on RenderThread. The changes in this CL
include:
- Convert all the animators in AnimatorSet for AVD into a set of RenderNodeAnimators.
- Hook up the new animators with RenderThread
- Add drawOp in RecordingCanvas for drawing VD so that during the animation
  on RenderThread, all the property changes on VD can be reflected on the screen.

TODO:
- Implement reverse and reset for AVD.

Change-Id: I2df1d754f2db0ad098d9c15dde4bb2bdfafc2315
2016-02-02 15:04:01 -08:00
Florin Malita
eecff56fed Add internal Canvas save flags
Skia's SkCanvas::SaveFlags are being deprecated.  This CL introduces
the equivalent android::SaveFlags, converts all internal clients to
the new enum, and switches the saveLayer glue to the
SaveLayerRec-based API.

Change-Id: Icb1785f4e7c0f652b1f04b34a1e3ccb063c408f3
2016-01-25 15:48:00 -05:00
Chris Craik
a1717271ca Initial text support in new reorderer/renderer
Removes obsolete drawPosText codepath, and unifies text decoration behavior.

Change-Id: I9c563249ab688a3394445a0e7fe1b9d0661f6f7c
2015-11-20 11:03:18 -08:00
Florin Malita
5e27140f48 Fix persistent Canvas clip handling
Partial Canvas save semantics (clip or matrix persisting after restore)
are currently emulated in the native canvas wrapper (SkiaCanvas.cpp).

Persistent clips (save w/ MATRIX_SAVE_FLAG only) in particular are
emulated using the SkCanvas clip stack.  There are two problems with
the current implementation:

1) The canvas save count is used to identify the clip stack topmost
frame, on the assumption that it is the same as the actual clip stack
save count.  But with the introduction of lazy SkCanvas saves in Skia,
the two values can diverge: the clip stack save count only reflects
*committed* saves, while the canvas save count includes both committed
and pending saves.  This means that we can no longer compare canvas and
clip stack save counts directly.

While we're looking at addressing the save count discrepancy in Skia
proper, we can also refactor the partial save emulation to no longer
rely on the two values being synchronized: instead of using the canvas
save count to locate the top clip stack frame, simply use the clip
stack save count for the same purpose - getClipStack()->getSaveCount()
always points to the correct top clip stack frame.

With this patch:

  * we use SkCanvas::getSaveCount() to track *canvas* save frames which
      require persistent matrix/clip handling (mSaveRecStack)
  * we use SkClipStack::getSaveCount() to extract the clips from the
    top clip stack frame

Also, since we're no longer mixing/comparing the two save counts, we
don't have to decrement the canvas value anymore (to make it zero-based
like its clip stack counterpart).

2) When iterating over clip stack elements, we currently start at
kTopIterStart and advance using next().  This is incorrect as next()
moves up the stack, so we only iterate over the topmost element =>
if there are multiple (non-consolidated) clip elements in the top
frame, we only get to see one.

We need to iterate using prev() instead.

Change-Id: Ic2d8cad684018925e749b9172fbf7c6202d9fb62
2015-11-06 18:40:25 +00:00
Leon Scroggins III
f35b989d26 Merge six commits from master-skia to master
Also corrects some code under development behind the HWUI_NEW_OPS flags
to match the updated Skia API.

Include external/skia/include/private
use SrcConstraint for drawBitmapRect
clean up to allow removal of flags for SCALAR_DIV and IMAGEINFO_FIELDS
don't call DEPRECATED getDevice()
update to newer API for drawBitmapRect
asABitmap is deprecated, used isABitmap

previous-Change-Id: I12208855a95948897077b1c1549eb35416cc801e
previous-Change-Id: I5044f0f61315fe48c60d7af5e261a7d0ed574f56
previous-Change-Id: Ic34a3ba77b3f9e091fa7aaba75018a307abacdab
previous-Change-Id: I79f8dd779920565d1204f7fe67b3286b1bbf4e9b
previous-Change-Id: Ic04d1f8274f6a862ea00f8d241363cf31f5ec1ec
previous-Change-Id: I9e4ae257a1976c74302b6a73f17405174ae58cec
previous-Change-Id: I85de3462ad1e4877784df38edc4bcd0acbd24e5e
Change-Id: Ide8e2f669e91a13c32521af3a16efdaa085c81d0
2015-10-29 12:29:03 -04:00
Tom Hudson
d8f904f256 Revert "Merge six commits from master-skia to master"
This reverts commit 550780745fa28ae9a87d02331841ca5ce4f9c763.

Change-Id: Ic71eccea454b26261fe6e9a9a7a24eff56396989
2015-10-28 20:35:36 +00:00
Leon Scroggins III
550780745f Merge six commits from master-skia to master
Include external/skia/include/private
use SrcConstraint for drawBitmapRect
clean up to allow removal of flags for SCALAR_DIV and IMAGEINFO_FIELDS
don't call DEPRECATED getDevice()
update to newer API for drawBitmapRect
asABitmap is deprecated, used isABitmap

Change-Id: I519f54f97321a7a365ea81a3b78cb03b9bdca021
previous-Change-Id: I12208855a95948897077b1c1549eb35416cc801e
previous-Change-Id: I5044f0f61315fe48c60d7af5e261a7d0ed574f56
previous-Change-Id: Ic34a3ba77b3f9e091fa7aaba75018a307abacdab
previous-Change-Id: I79f8dd779920565d1204f7fe67b3286b1bbf4e9b
previous-Change-Id: Ic04d1f8274f6a862ea00f8d241363cf31f5ec1ec
previous-Change-Id: I9e4ae257a1976c74302b6a73f17405174ae58cec
2015-10-28 13:41:38 -04:00
Ben Wagner
b03198de9f Merge "Use static_assert instead of SK_COMPILE_ASSERT." 2015-08-20 14:56:10 +00:00
Ben Wagner
e3a40ea488 Use static_assert instead of SK_COMPILE_ASSERT.
Now that static_assert is allowed, there is no need to use a non-
standard compile time assertion.

Change-Id: I0b294efcf494983f8241e9d5a2c476e2f2a9fff0
2015-08-19 17:21:17 -04:00
Chris Craik
6daa13c5fa Change setMatrix behavior to only affect canvas-local matrix
bug:22189925

This makes setMatrix(getMatrix()) work as expected, and makes setMatrix()
much more useful without changing behavior relative to a View's parent
hierarchy.

Change-Id: I608613bd27c1b9052ae583f8fd2119cf37a2f6d7
2015-08-19 13:32:15 -07:00
Ben Wagner
d1cbc16089 Use 'new' instead of 'SkNEW'.
There isn't any good reason for Android code to be using SkNEW,
and in some places it is potentially an issue. Also, SkNEW really
should be considered private to Skia at this point.

Change-Id: I35c675bd2c45b7a65c526508c202a30e30859491
2015-08-19 13:04:36 -04:00
Ben Wagner
6bbf68d05a Remove use of SkAutoSTMalloc from Android.
Skia desires to make SkTemplates.h private since the classes there
are designed only for internal use.

Change-Id: I1e05e54de9eb68e50ccd6a691889fecf34bc9cea
2015-08-19 11:26:06 -04:00
Derek Sollenberger
edca320a2b Add ninePatch support to Canvas.h
Change-Id: Ib3202fd7c5b9f35853f286abe84b3ed009df1a81
2015-08-14 14:59:37 -04:00
Ben Wagner
60126efd7d Use unique_ptr instead of SkAutoTDelete.
Skia would like to make SkAutoTDelete private, given that unique_ptr
now exists and is a better standard alternative.

Change-Id: Ie21bc4546c93e2096c1e43b26eb3ef80b8f11de4
2015-08-07 17:54:35 -04:00
Derek Sollenberger
6578a98956 Support High Contrast Text for all canvas types
Change-Id: Iee324446798fe1a1cb32cb991f181a4af24aa93c
2015-07-29 16:02:14 -04:00
Chris Craik
749e67438c Revert "Support High Contrast Text for all canvas types"
bug:22820834

This reverts commit 876d56612ab8ec7032f702905d694670e6c4febd.

Change-Id: I4e07a0894095caaaf2fd36bfa6073d033542bfc4
2015-07-29 18:14:46 +00:00
Derek Sollenberger
876d56612a Support High Contrast Text for all canvas types
Change-Id: Ib46ba3d7c67e081872e6a4b11d294fe9a61f5bbd
2015-07-13 15:13:15 -04:00
Derek Sollenberger
94394b3fb0 Move drawRegion from DisplayList to Canvas
Change-Id: I9f401dc5b24732938ac2ca7ed829796e2d7ef3e8
2015-07-13 13:48:08 -04:00
Tom Hudson
ac7b6d33d2 New setLocalMatrix() operation for HWUI
Concats any matrix passed through from DisplayListCanvas with the
initialTransform of the containing RenderNode.

BUG:22189925

Change-Id: I5ea54a6e2a29520c79a8860bde7682694e8595d2
2015-07-09 16:15:31 -04:00
Chris Craik
5ec6a2878b Unify clipping return value behavior - true if not empty
bug:22035484

Change-Id: I23ecca38554a60c590181290900deb0e2c48cea1
2015-06-23 15:42:43 -07:00
John Reck
c1b33d665c GraphicsJNI Canvas cleanup
Change-Id: I72e142986a8bc9f464c1951b6b5187919de3462e
2015-04-22 09:34:34 -07:00
John Reck
9d4efdf280 Revert "A bunch more cleanups"
This reverts commit c294d128d03bc9a9982b273a82516c04583438cc.

Change-Id: Id1ebb236950f7c36c6d86e1dd95566d3a200748d
2015-04-17 20:47:27 +00:00
John Reck
f7a61483bc Merge "A bunch more cleanups" 2015-04-15 14:48:19 +00:00
John Reck
c294d128d0 A bunch more cleanups
Switch a few places to using android::canvas
instead of SkCanvas as well which eliminated
some JNI

Change-Id: I8f98b56442a06362b82b984cd1bd3a92398d8dbc
2015-04-14 15:38:22 -07:00
Tom Hudson
34e79c1e57 Convert from glyph count to byte length
Canvas drawText* APIs are inconsistent, and this mismatch snuck through
our tests.

BUG=skia:3636
R=djsollen@google.com

Change-Id: Ibaab512c3f19df8445d582633b2748f1ec4d2902
2015-04-14 11:34:39 -04:00
Derek Sollenberger
0313f2680c Remove uncessary include for SkPorterDuff.h
Change-Id: Ibcbed5dd2dc327821fc26e87191185f0069c9911
2015-03-05 16:22:17 -05:00
Derek Sollenberger
b3d50e0075 Rename Canvas::getSkCanvas to Canvas::asSkCanvas
Change-Id: I967a45698d382e54eaa5ff64fa8909ff00908650
2015-01-29 11:25:55 -05:00
John Reck
849911a9c4 Move Canvas
Change-Id: I83d557af30fc2d5c69d06eedc0f4d52ac41c4210
2015-01-20 12:39:05 -08:00