22 Commits

Author SHA1 Message Date
Derek Sollenberger
35934cccab Compute text bounds on a per glyph basis when drawing from an SkPicture.
bug: 27665826
Change-Id: I031c08a348b2488c85f74e708ee90019b24d707f
2016-03-25 17:10:27 +00: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
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
Leon Scroggins III
5518e7cbd4 Override getSaveLayerStrategy instead of willSaveLayer
willSaveLayer was removed in https://codereview.chromium.org/1537193002

Requires SkCanvas::SaveLayerFlagsToSaveFlags, added in ag/839104
(Ic78acd6d780245bd30b891e7dcabe29daacc17f4)

Change-Id: Idc49b38fc7939620267b4402ff3846b29f27c81a
(cherry picked from commit e208643a6f9d076274dd683c51a086b1e3679896)
2016-01-12 18:20:38 +00:00
Derek Sollenberger
d2db5c10a3 Remove onDrawSprite API as it is no longer exposed via SkCanvas
Change-Id: Id6f0bb7a9b4eaad0d0442d4ab4212f6a56070c66
2015-12-16 16:58:32 +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
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
Ben Wagner
a11ee3c413 Add Skia includes where needed.
A proposed change in Skia will forward declare more classes in more
headers. As a result, some Skia headers need to be explicitly
included.

Change-Id: I577095afde9de0e36b8f904aee91979b01e30726
2015-08-04 17:28:43 +00:00
Tom Hudson
0f6cb32c75 am a5e2946f: am b9d7bba5: am 434b577f: am 8ac76504: am 9613e9b7: Merge "New setLocalMatrix() operation for HWUI" into mnc-dev
* commit 'a5e2946f5ab7618997fb317ad9f5f56c160ebee5':
  New setLocalMatrix() operation for HWUI
2015-07-10 13:35:27 +00: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
Tom Hudson
17c5adfa63 drawBitmap() support for extractSubset()
In SkiaCanvasProxy, translate drawBitmap() calls on bitmaps which
are the result of extractSubset() into drawBitmapRect() calls on the
original PixelRef.

If HWUI isn't going to support subsetting, we'll need to do this,
probably at additional entry points, to interoperate with native Skia
bitmaps. This change by itself fixes the extractbitmap GM.

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

Change-Id: I5744da87d8f16dc1a252f606dfaa4016bd01e66e
2015-06-09 15:46:04 -04:00
Tom Hudson
20c2b3ef74 Fix positioned text bounds
drawPosText() bounds weren't taking their offset into account properly
in absolute-positioned cases.

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

Change-Id: Ic39fd45491231ed3e3949ffbc1f063a4fc12c3f8
2015-04-15 13:54:32 -04:00
Tom Hudson
b1476ae7d5 Fix bug, change crashes to warnings
Improve behavior when we get a call to draw 0 points.
Replace one ALWAYS_FATAL statements with noop.

Change-Id: I864b7a9633dfa3dc6eefa403beca4cc7ae14074f
2015-03-05 10:31:52 -05:00
Tom Hudson
806a6f07a3 Fix onDrawText for non-absolute positioning
If we were drawing text with drawTextAbsolutePos() false, we would
draw the first character at 0,0 but subsequent characters would get
improperly offset by y. (or x if vertical text)

Change-Id: I4e76cd9d95bf1bb6ac021d99ef7cdd6333a290ba
2015-02-20 13:08:47 +00:00
Derek Sollenberger
1db141f93c Create proxy between Skia's SkCanvas and the framework Canvas.
This enables Picture.java to be replayed into HWUI in addition
to extending the Skia testing suite to HWUI.

Bug: 19011232
Change-Id: Id27ac03eec817b0784763e62ab8413a07b3b8cb2
2015-01-30 12:56:37 -05:00