8703 Commits

Author SHA1 Message Date
Matt Sarett
00ce770070 Merge "Bug fix: use legacy SkCanvas regardless of color space tag" into oc-dev am: 101dc265a8
am: 7e92ac449b

Change-Id: Ic50bd5fe0358390024bdb9a34e14906dba669f25
2017-04-14 19:02:54 +00:00
Seigo Nonaka
24c6464663 Merge "Use provided style for fallback font selection" into oc-dev am: 43112fd26e
am: 83c52e0a40

Change-Id: Ia42f6a377c2617c8da9a84cb8bd7781326e464a1
2017-04-14 18:09:55 +00:00
Matt Sarett
ca9b703b88 Bug fix: use legacy SkCanvas regardless of color space tag
Test: Added unit test. CtsGraphicsModule.

Bug: 32984164

Change-Id: If72e1e31c98e01f97f3a05d763f5d4c71cf88313
2017-04-14 16:26:50 +00:00
Jim Van Verth
99effcccbc Merge "Add uncached and perspective shadows to Skia renderer" into oc-dev am: 1be9766a68
am: c7fd8db8a6

Change-Id: If7f3bfc01496a9fe9b198dc63bd7c064943c9008
2017-04-14 16:03:13 +00:00
Seigo Nonaka
659c9cfac3 Merge "Introduce setFallbackTypeface" into oc-dev am: 729a515e5e
am: 17452ee553

Change-Id: I66fe816727aae3fdf617c41796b25478090704fe
2017-04-14 15:31:25 +00:00
Seigo Nonaka
d154829cb1 Use provided style for fallback font selection
If the developer gives some weight/italic to the Typeface.Builder
the fallback used the metadata in the font file. We should use
provided data instead.

This CL also adjusts upper and lower limits on weight, from 100..900 to
1..1000

Bug: 37257745
Bug: 37251569
Test: android.graphics.cts.TypefaceTest passes
Change-Id: I7cf390d96b49afcce359928373698b0c9a9babd8
2017-04-14 00:54:46 +00:00
Jim Van Verth
1be9766a68 Merge "Add uncached and perspective shadows to Skia renderer" into oc-dev 2017-04-13 20:01:47 +00:00
TreeHugger Robot
5690917679 Merge "Add SkiaCanvas::captureCanvasState()" 2017-04-13 19:54:11 +00:00
TreeHugger Robot
729a515e5e Merge "Introduce setFallbackTypeface" into oc-dev 2017-04-13 19:21:25 +00:00
Matt Sarett
d0814db633 Add SkiaCanvas::captureCanvasState()
Test: Verified bug is fixed.  Wrote unit test.

Bug: 37268771

Change-Id: I9deb7db353cd2129ad245e7f65419670463bb717
2017-04-13 14:23:38 -04:00
TreeHugger Robot
4085d2cd80 Merge "lockPixels is no longer virtual" 2017-04-13 17:52:12 +00:00
Seigo Nonaka
5b6347a6af Introduce setFallbackTypeface
setFallbackTypeface is returned by Builder.build() method when the
provided font is not loaded due to some reasons.
The fallback family is resolved with width/italic passed to Builder.

Bug: 36794225
Test: android.graphics.cts.TypefaceTest passes
Change-Id: I65e220aca823fd815a52437b11c8e6dc952de8e2
2017-04-13 10:12:27 -07:00
Matt Sarett
44dc270830 Add SkiaCanvas::captureCanvasState()
Test: Verified bug is fixed.  Wrote unit test.

Bug: 37268771

Change-Id: I9deb7db353cd2129ad245e7f65419670463bb717
2017-04-13 11:11:11 -04:00
Jim Van Verth
5745a0a37f Add uncached and perspective shadows to Skia renderer
Test: manual - looked at FrameworkShadow app

Bug: 37300468
Change-Id: I72d820479141db2d83363747d9f76abbaca70d98
2017-04-13 13:15:12 +00:00
Derek Sollenberger
86a1c30a11 Merge "Change behavior of setBitmap to cleanly reset the canvas" into oc-dev am: 7944962b7e
am: 43844db75d

Change-Id: I8e362993a2fc51ce93015924d4819884301aa0c1
2017-04-12 17:59:18 +00:00
Mike Reed
2cb0826d2e lockPixels is no longer virtual
See skbug.com/6481

With pixelrefs now always (logically) locked, we no longer override
onNewLockPixels/onUnlockPixels. We also must now pass our
address/rowBytes to the base constructor.

These changes allow us to remove duplicate fields in the hwui Bitmap
subclass -- mRowBytes and mColorTable, since these fields are now always
available from the base-class.

However, since this subclass still wants to overwrite const fields in
the base-class (its reconfigure api), change the impl to use the newly
added private method (android_only_reset) to encapsulate this.

Test: hwui_unit_tests and CtsGraphicsTestCases pass

Change-Id: I57a3af1135580513b708f35549a6defb7ac6c04e
2017-04-12 11:52:22 -04:00
Derek Sollenberger
eb69cbbe22 Change behavior of setBitmap to cleanly reset the canvas
- identity matrix
 - no save stack
 - wide-open clip

This reverts commit 4f641d1e4586b027969052cc0ad6b65c1158e72e

Test: bit CtsGraphicsTestCases:.CanvasTest
Bug: 36218535
Change-Id: Id11deb06e37d6df61f1f171d424ab150d812a7a8
2017-04-11 14:00:25 -04:00
Mike Reed
63df65dfe2 mark mPixelStorageType const
This is a natural consequence of the fact that we always call
setPreLocked from the constructor. Future Skia will remove the virtual
for lockPixels (onNewLockPixels), but that is compatible with this
subclass since does not change its pixel-addr or pixel-type after the
constructor.

See skbug.com/6481 for more details

Test: existing tests apply, no behavior change

Change-Id: I0f9d3efc9a05b71907480eaaadbc7fafe9dd491b
2017-04-10 17:46:03 +00:00
Romain Guy
0246a298f9 Merge "Color management, the missing pieces" into oc-dev am: 7dfa16c2ef
am: 3eafcb2d8b

Change-Id: I079d8d17982eecc022f2a53e1e6ca193dc7a3ace
2017-04-07 18:48:57 +00:00
Romain Guy
8242656f49 Color management, the missing pieces
Implement missing color management pieces for bitmaps:

- Bitmap.createBitmap(Bitmap src, ...) now creates a bitmap
  in the same color space as the source bitmap
- Bitmap.createScaledBitmap() now creates a bitmap in the
  same color space as the source bitmap
- Bitmap.createBitmap(..., ColorSpace colorSpace) to create
  bitmaps in a specific color space
- Fix copy from A8 to F16
- Copying bitmaps in F16 or with a color space does not work,
  it's currently a limitation in Skia

Bug: 36905374
Test: BitmapColorSpaceTest
Change-Id: I0092fe4432511db50daa3a9393389a9db05e0c2a
2017-04-07 07:56:14 -07:00
Romain Guy
ef6c9b1d8b Merge changes I6f00614d,I987eeab2 into oc-dev am: c273784c91
am: 3b447f6ed7

Change-Id: Ia6c35dd4a3fff3c300cb8c390d9628481605928a
2017-04-06 22:46:04 +00:00
Matt Sarett
7c9fb6076e Merge "Xform bitmaps to sRGB on SW and PDF canvases" into oc-dev am: c29dffed16
am: fd5d5425ee

Change-Id: If960ccd900ebc2b841c2f13ca4f25820a48a950f
2017-04-06 22:16:49 +00:00
TreeHugger Robot
c273784c91 Merge changes I6f00614d,I987eeab2 into oc-dev
* changes:
  Convert 16 bit bitmaps to 8 bit on devices that do not have GLES3.0
  Fix HardwareBitmapTests.testBitmapConfigFromRGB565
2017-04-06 21:21:59 +00:00
Romain Guy
89de234c72 Convert 16 bit bitmaps to 8 bit on devices that do not have GLES3.0
Bug: 37077308
Test: CtsUiRenderingTests (ran to manually emulate 2.0 devices)
Change-Id: I6f00614d79797835adcfe4716bd331573e1463e3
2017-04-06 12:24:29 -07:00
Romain Guy
7c98f5da3d Fix HardwareBitmapTests.testBitmapConfigFromRGB565
Bug: 37077304
Test: HardwareBitmapTests.testBitmapConfigFromRGB565
Change-Id: I987eeab243f93f9ee8fe8d1b6a12ddbd23225651
2017-04-06 11:00:21 -07:00
Matt Sarett
ea70d22dc8 Xform bitmaps to sRGB on SW and PDF canvases
For picture-backed canvases, we will defer the xform
until playback.

Test: Unit tests and cts test.
Bug: 32984164
Change-Id: Ib74663bcb688b74b6ba8792b403b0475126732af
2017-04-06 15:14:00 +00:00
Mike Reed
d20f2c2d02 use new api for passing colortable to allocPixels
Test: Bitmap:colorTableRefCounting still passes

Change-Id: I5f20a55a98f5766da7c4a490c9be56f9140024c3
2017-04-05 17:39:25 -04:00
Mike Reed
826deefda5 switch over to SkVertices object, and stop using deprecated methods.
This allows Skia to remove
  SK_SUPPORT_LEGACY_CANVAS_VERTICES
  SK_SUPPORT_LEGACY_BITMAP_SETPIXELREF
  SK_SUPPORT_LEGACY_PIXELREFFACTORY

Test: Existing CTS cover these changes

Running CtsGraphicsTestCases, there were 6 failures w/ and w/o this CL.
None of the 6 seems related to this CL.

Change-Id: I724082357d9f6cb699770df3c0b9ef555b957697
2017-04-05 14:20:38 +00:00
Stan Iliev
9b21b970bc Merge "Fix pop-up shadow drawn in the wrong place with Skia pipeline" into oc-dev am: a5c6ba3473
am: 563c5d3643

Change-Id: I8a24e8d642d49cb4822db50bbf3b2fe6e5ec9122
2017-04-04 22:34:40 +00:00
TreeHugger Robot
9d64a418bb Merge "Optimize Canvas::drawGlyphs" 2017-04-04 21:36:10 +00:00
Stan Iliev
d7410f7829 Fix pop-up shadow drawn in the wrong place with Skia pipeline
Fix a bug in DrawShadow matrix calculation. Recorded matrix does
not need to be applied, because parent display lists have already
replayed matrix transformations.

Test: added a new HWUI unit test that is passing only after this fix
Bug: 33103723
Change-Id: I7a47dbe879df6b9e5920a47c0e1168d9902a3e70
2017-04-04 16:24:55 -04:00
Stan Iliev
0b58d99283 Optimize Canvas::drawGlyphs
Avoid one memcpy in Canvas::drawGlyphs for all pipelines.

Test: CTS passed with exception of SweepTests#testBasicDraws
shadowtext, which fails with and without this CL.
Change-Id: I0841232dc7a6173eb3b03f939dbde15a84186296
2017-04-04 15:43:12 -04:00
Derek Sollenberger
4d6141c297 Merge "Fix HWUI/Skia Gradients to premultiply the colors prior to interpolation" into oc-dev am: f9340ca491
am: d75510ab6f

Change-Id: Iffb6644220b68790553ca9fa08ab2e4b532e50cb
2017-04-04 19:33:52 +00:00
TreeHugger Robot
f9340ca491 Merge "Fix HWUI/Skia Gradients to premultiply the colors prior to interpolation" into oc-dev 2017-04-04 19:06:32 +00:00
Chris Craik
5d2e064ebf Merge "Revert "Switch libplatformproto to sharedlib"" into oc-dev am: eabb5621dd
am: f497ca5a2e

Change-Id: I0a7bf55e5614b5b8f380332c2cd43d7d14df4e66
2017-04-04 17:35:53 +00:00
Chris Craik
eabb5621dd Merge "Revert "Switch libplatformproto to sharedlib"" into oc-dev 2017-04-04 17:16:43 +00:00
Derek Sollenberger
669b15a935 Fix HWUI/Skia Gradients to premultiply the colors prior to interpolation
This is fixed in Skia by passing the appropriate flag when the shader is
generated.  The fix in HWUI is to reverse the premultiplication and
interpolation steps.

Test: bit CtsUiRenderingTestCases:.testclasses.ShaderTests
Bug: 34323783
Change-Id: I3417141949f62fcc696b6d8213a4b446d7d0cbf8
2017-04-04 12:07:28 -04:00
TreeHugger Robot
29e77fe359 Merge "Don't use deprecated canvas methods" 2017-04-04 15:09:45 +00: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
Chris Craik
817b494739 Revert "Switch libplatformproto to sharedlib"
Bug:36847782

This reverts commit e5549d414c7231ee0037cf413dad17e28b8905ba.

Change-Id: I38f1c501b7e40be11ba5f0a7a50651e0c3e41fc5
2017-04-03 21:46:44 +00:00
TreeHugger Robot
7a41511805 Merge "Fix error in RenderNode unit test with Skia pipeline" 2017-04-03 20:56:48 +00:00
Mike Reed
6813635aea add temporary cast to allow Skia roll
Test: refactoring CL. Existing unit tests still pass.

Change-Id: I2e2a647bfad76af313db70d196566e01bf909fc8
2017-04-03 13:14:35 -04:00
Stan Iliev
25912c78f5 Fix error in RenderNode unit test with Skia pipeline
Fix failing RenderNode unit tests with Skia pipeline, caused by
TestUtils::syncHierarchyPropertiesAndDisplayList not walking past
root node.

Test: ran HWUI unit tests.
bug: 32507847
Change-Id: I7e64fb02fd8f4874eadacafcac7e9f1ae4e56365
2017-03-31 14:00:20 -04:00
TreeHugger Robot
62027f69c0 Merge "Add test configs to hwui tests" 2017-03-31 17:04:33 +00:00
John Reck
3c9c29ee38 Merge "Switch libplatformproto to sharedlib" into oc-dev am: 72c2760943
am: af39ba5d49

Change-Id: I73d9035f13f83c80045004867b4470779095d603
2017-03-30 17:32:00 +00:00
TreeHugger Robot
72c2760943 Merge "Switch libplatformproto to sharedlib" into oc-dev 2017-03-30 16:42:36 +00:00
TreeHugger Robot
b7a10e6b4a Merge "Add comments to clarify how SkDrawable dtor is called" 2017-03-30 15:14:53 +00:00
Romain Guy
427bb80ea8 Merge "Convert bitmaps to sRGB/scRGB when they have a color profile" into oc-dev am: 33813bd439
am: 6869c55106

Change-Id: I69b4e1ba160032255891fbb2656445badd5b936e
2017-03-30 01:53:07 +00:00
Romain Guy
33813bd439 Merge "Convert bitmaps to sRGB/scRGB when they have a color profile" into oc-dev 2017-03-30 01:42:32 +00:00
John Reck
e5549d414c Switch libplatformproto to sharedlib
libplatformprotos is really really unhappy if it gets
loaded twice into the same process which trivially happens
if it's a static library. Switch it to a shared library
instead to fix this.

Change-Id: I90297d076d0739bab683fbd9607d7fc0884a002d
Fixes: 36272398
Test: Ran hwui_unit_test, didn't crash
2017-03-29 18:41:27 -07:00