290 Commits

Author SHA1 Message Date
TreeHugger Robot
7a7c921e18 Merge "Add more Skia pipeline unit tests." 2016-12-12 20:59:45 +00:00
Stan Iliev
52771272f4 Add more Skia pipeline unit tests.
Add more Skia pipeline unit tests and fix an issue
in backdrop/content bounds clip logic.

Test: built and run angler-eng and HWUI unit tests.
Change-Id: Ie41f80ff7ce9802a4d76e8b14f1695dbc9771a2b
2016-12-12 14:13:16 -05:00
TreeHugger Robot
8600928705 Merge "Make HWUI makefile include external/skia/src/utils" 2016-12-12 17:35:46 +00:00
Leon Scroggins III
82c581dac3 Make HWUI makefile include external/skia/src/utils
Test: none. No new code; this just makes it explicit that HWUI is
depending on headers in Skia's src/utils directory.

This is needed for SkTextureCompressor.h, which itself is pulled in
transitively through SkGlyphCache.h. Adding this here means that Skia
need not list src/utils as an exported include dir.

Change-Id: I3f2b022504486b7a640236fb98a497b599b42a6b
2016-12-12 16:15:49 +00:00
Greg Daniel
cd55852fcd Make buffer age work in Vulkan
Test: manual testing in skiavk mode

Change-Id: I5b9d8af7d9cecf2f022ef104ec33a5b7477e9e0c
2016-12-09 15:45:15 +00:00
TreeHugger Robot
e9bf7c8436 Merge "Introduce PathInterpolator to native animators" 2016-12-01 20:21:13 +00:00
Doris Liu
9e9eeeeb78 Introduce PathInterpolator to native animators
For interpolators defined with a path, PathInterpolator is more accurate
and likely less costly for longer animations than what are currently
using as a substiute - LUTInterpolator.

Test: manual test and added a unit test
BUG: 32830741
Change-Id: I867c7a28e4261392cce9c45a2992ab4fd120c496
2016-11-30 16:03:23 -08:00
sergeyv
71c4477bee Add hwui test for correct refcounting of SkColorTable in Bitmap
Test: BitmapTests.colorTableRefCounting
bug:32561595
Change-Id: I505c735feffbac18d406b6b2f9dff51d81700cd8
2016-11-30 13:42:52 -08:00
Stan Iliev
db45a4bfaf Fix Skia render node projection to match HWUI
Fix Skia render node projection to match HWUI. Port
FrameBuilderTests_projectionReorder test for Skia pipeline.
Add new tests in both HWUI and Skia to cover more projection
use cases.

Test: built and run on angler-eng
Change-Id: Ibf27af211452ae95d595aca7723ea63f48b0b282
2016-11-22 16:38:20 -05:00
Derek Sollenberger
c4fbada76a Support Surface and Layer Readback in the SkiaPipelines.
Test: CTS TextureViewTests and UIRendering
Change-Id: I2969c8f5a975bfd9aebcbb585c64d1fcbb2487c2
2016-11-16 13:30:00 -05:00
Derek Sollenberger
0e3cba3146 Handle vulkan windowing directly in SkiaVulkanPipeline
Test: manual testing in skiavk mode
Change-Id: I2fab80bae2787bfdacbc70d0402e98450e59406d
2016-11-09 11:58:36 -05:00
Matt Sarett
cf2c05c652 Add SkiaProfileRenderer to draw visual debugging info
This adds support for debug.hwui.profile and
debug.hwui.show_dirty_regions to the Skia pipelines.

There still may be some follow up work for profiling
with visual bars.  The speed at which the renderer
is able to draw the rects in the graph is having a
noticeable effect on the actual data in the graphs.

Test: Verified that the features work as expected.

BUG:32370375

Change-Id: I24430da2bab3eb54f6a771f9c984f8ae0008a5a7
2016-11-03 21:42:58 -04:00
TreeHugger Robot
40800725d2 Merge "Implement Skia pipelines for OpenGL and Vulkan." 2016-11-03 19:59:46 +00:00
Stan Iliev
500a0c30d4 Implement Skia pipelines for OpenGL and Vulkan.
Implement Skia pipelines for OpenGL and Vulkan:
base SkiaPipeline, SkiaOpenGLPipeline and SkiaVulkanPipeline.
Write unit tests for SkiaPipeline.

Test: Built and run manually on angler-eng.
Change-Id: Ie02583426cb3547541ad9bf91700602a6163ff58
2016-11-03 13:28:49 -04:00
John Reck
f0503b0b6f Merge "Add benchmarks for View inflation" 2016-11-03 17:14:57 +00:00
John Reck
3acf0382da Add benchmarks for View inflation
Also speed up RenderNode creation:

Use finalizer() instead of NativeAllocationRegistry, this
shaves ~3us off of creation currently

Avoid instanceof, instead have SurfaceView explicitly ask
for updates.

Remove unused method call.

Test: ran benchmarks
Change-Id: I3117fdf72313a4e6a9965baca9f2a8b855c19b34
2016-11-02 14:49:51 -07:00
Stan Iliev
021693b967 Implement SkiaRecordingCanvas, RenderNodeDrawable and other drawables.
Implement SkiaRecordingCanvas, RenderNodeDrawable, GLFunctorDrawable,
LayerDrawable, StartReorderBarrierDrawable, EndReorderBarrierDrawable.
Move AnimatedRoundRect and AnimatedCircle in a separate file.
All Skia pipeline files are moved in hwui/pipeline/skia folder.
Add unit tests for RenderNodeDrawable, StartReorderBarrierDrawable,
EndReorderBarrierDrawable and SkiaRecordingCanvas.

Test: I tested manually on 6P devices and did run the unit tests.
Change-Id: If2a347bd1fc4689953822294ce5bf98c7f3f57c7
2016-10-31 14:27:02 -04:00
TreeHugger Robot
c024377dcf Merge "Implement getTransparentRegion() using SkLatticeIter" 2016-10-27 14:13:19 +00:00
Matt Sarett
7de7385897 Implement getTransparentRegion() using SkLatticeIter
This allows us to delete utils/NinePatchImpl.cpp and
utils/NinePatch.h

Test: Passed cts tests - DrawableTest, NinePatchTest,
NinePatchDrawableTest.

Change-Id: I6b5d09fa3479e758d8b931fa0e977c25f4435a7c
2016-10-27 08:22:38 -04:00
Derek Sollenberger
daf7229047 Move OpenGL specific details behind renderPipeline interface.
Test: new and existing unit tests still pass.
Change-Id: I6164f30f45ebe450788ed8d949eca5af9a44e585
2016-10-26 12:46:57 +00:00
Matt Sarett
de97307362 Make FrameInfoVisualizer use an IRenderPipeline to draw
Removing the direct uses of the BakedOpRenderer should make
it easier for the SkiaGL pipeline to take advantage of these
debugging features.

Test: Verified that debug.hwui.show_dirty_regions and
debug.hwui.profile still behave as expected.

BUG:32370375

Change-Id: I2818bda4a18ec183c9c39ca080ad34a4dc89b5cd
2016-10-25 17:44:55 -04:00
sergeyv
c1c54062f8 Rename hwui/PixelRef to hwui/Bitmap
Test: refactoring cl.
bug:32216791

Change-Id: I26de43f71027bccb43a5011f84080ab4631b2883
2016-10-20 09:48:02 -07:00
Derek Sollenberger
6e68bedacc Merge "Initial refactoring to enable the addition of the SkiaOpenGLPipeline." 2016-10-13 16:53:14 +00:00
Romain Guy
21986f2ae7 Merge "Linear blending, step 1" 2016-10-12 15:52:14 +00:00
Romain Guy
253f2c213f Linear blending, step 1
NOTE: Linear blending is currently disabled in this CL as the
      feature is still a work in progress

Android currently performs all blending (any kind of linear math
on colors really) on gamma-encoded colors. Since Android assumes
that the default color space is sRGB, all bitmaps and colors
are encoded with the sRGB Opto-Electronic Conversion Function
(OECF, which can be approximated with a power function). Since
the power curve is not linear, our linear math is incorrect.
The result is that we generate colors that tend to be too dark;
this affects blending but also anti-aliasing, gradients, blurs,
etc.

The solution is to convert gamma-encoded colors back to linear
space before doing any math on them, using the sRGB Electo-Optical
Conversion Function (EOCF). This is achieved in different
ways in different parts of the pipeline:

- Using hardware conversions when sampling from OpenGL textures
  or writing into OpenGL frame buffers
- Using software conversion functions, to translate app-supplied
  colors to and from sRGB
- Using Skia's color spaces

Any type of processing on colors must roughly ollow these steps:

[sRGB input]->EOCF->[linear data]->[processing]->OECF->[sRGB output]

For the sRGB color space, the conversion functions are defined as
follows:

OECF(linear) :=
linear <= 0.0031308 ? linear * 12.92 : (pow(linear, 1/2.4) * 1.055) - 0.055

EOCF(srgb) :=
srgb <= 0.04045 ? srgb / 12.92 : pow((srgb + 0.055) / 1.055, 2.4)

The EOCF is simply the reciprocal of the OECF.
While it is highly recommended to use the exact sRGB conversion
functions everywhere possible, it is sometimes useful or beneficial
to rely on approximations:

- pow(x,2.2) and pow(x,1/2.2)
- x^2 and sqrt(x)

The latter is particularly useful in fragment shaders (for instance
to apply dithering in sRGB space), especially if the sqrt() can be
replaced with an inversesqrt().

Here is a fairly exhaustive list of modifications implemented
in this CL:

- Set TARGET_ENABLE_LINEAR_BLENDING := false in BoardConfig.mk
  to disable linear blending. This is only for GLES 2.0 GPUs
  with no hardware sRGB support. This flag is currently assumed
  to be false (see note above)
- sRGB writes are disabled when entering a functor (WebView).
  This will need to be fixed at some point
- Skia bitmaps are created with the sRGB color space
- Bitmaps using a 565 config are expanded to 888
- Linear blending is disabled when entering a functor
- External textures are not properly sampled (see below)
- Gradients are interpolated in linear space
- Texture-based dithering was replaced with analytical dithering
- Dithering is done in the quantization color space, which is
  why we must do EOCF(OECF(color)+dither)
- Text is now gamma corrected differently depending on the luminance
  of the source pixel. The asumption is that a bright pixel will be
  blended on a dark background and the other way around. The source
  alpha is gamma corrected to thicken dark on bright and thin
  bright on dark to match the intended design of fonts. This also
  matches the behavior of popular design/drawing applications
- Removed the asset atlas. It did not contain anything useful and
  could not be sampled in sRGB without a yet-to-be-defined GL
  extension
- The last column of color matrices is converted to linear space
  because its value are added to linear colors

Missing features:
- Resource qualifier?
- Regeneration of goldeng images for automated tests
- Handle alpha8/grey8 properly
- Disable sRGB write for layers with external textures

Test: Manual testing while work in progress
Bug: 29940137

Change-Id: I6a07b15ab49b554377cd33a36b6d9971a15e9a0b
2016-10-11 17:47:58 -07:00
Sergei Vasilinetc
e9eefce9f8 Merge "Move PixelRef to hwui Test: refactoring cl. bug:27762775" 2016-10-11 18:08:56 +00:00
sergeyv
0728f0872f resolve merge conflicts of e830f35 to master
Change-Id: I4d2b10a6a2ac983986775f1f925c4a09734bb70d
2016-10-10 18:20:04 -07:00
sergeyv
e830f351e1 Turn off additional logging in text rendering am: 5bb5626599
am: 4778f6a43e

Change-Id: If031a1d480d8c2e75e9f6268d15c8ccc098a0268
2016-10-11 00:54:34 +00:00
sergeyv
5bb5626599 Turn off additional logging in text rendering
Change-Id: If5f11489c05e320e4436fb57680857b29228a755
b:30427106
2016-10-10 12:25:06 -07:00
sergeyv
163f88140e Move PixelRef to hwui
Test: refactoring cl.
bug:27762775

Change-Id: Idd13b865ce22d4c51ced9b0fe3e9174452e87c6e
2016-10-07 17:01:41 -07:00
Derek Sollenberger
0df6209a02 Initial refactoring to enable the addition of the SkiaOpenGLPipeline.
Test: existing and new HWUI unit tests all pass.
Change-Id: I4f5c1dc839a2ed15d8b0f6245fe030684501b083
2016-10-05 15:28:27 -04:00
sergeyv
dcbc0e9e25 resolve merge conflicts of 0ec2fd7 to master
Change-Id: I113ede26ab42e3f9a36a52a756c38d365731e16d
2016-09-14 09:15:15 -07:00
sergeyv
0ec2fd7bc5 HWUI: track upload & recent usage in font cache am: af102bee51
am: 42c01cf62f

Change-Id: Ieb80108d520aa629c54a40d7c533bf74a71849c4
2016-09-13 02:01:28 +00:00
sergeyv
af102bee51 HWUI: track upload & recent usage in font cache
FontCacheHistoryTracker should be turned off before shipping: b/31438876

bug:30427106
Change-Id: Ic26b25e790d4ee69e484ca0cb23dc9cc522b2ed3
2016-09-12 15:45:26 -07:00
Hugo Benichi
63d8aa930f Merge \\\"Fix missing IpConnectivity metrics\\\" into nyc-mr1-dev am: 66e7752ad1 am: b2db402899
am: fb5c675b7e

Change-Id: Iba1f81a892acd9f541b9dd564203bfebc56c9c73
2016-07-31 02:13:00 +00:00
John Reck
fb5c675b7e resolve merge conflicts of 67daab6 to nyc-mr1-dev-plus-aosp
Change-Id: I35f867b8d6408a7eae9cf5643f0908259de90cb1
2016-07-29 10:08:16 -07:00
John Reck
2d5b8d7392 Teach JankTracker about new swap behaviors
Bug: 30440166

If we are using HWC2, there's a change in timing
when in triple buffering with the pipelined offsets.
This changes JankTracker to recognize that and silently
erase that from the total duration

Change-Id: Ib1fd4209070f17dbd2baed707c8cf73fb11c3cf2
2016-07-29 07:56:02 -07:00
Derek Sollenberger
56ad6ec42f Remove LayerRenderer.
There is only one caller each for the static functions here so this
CL moves the logic to the caller.  Also by moving some of the code
into the pipeline it makes it easier for future changes to configure
how a pipeline handles a layer.

Change-Id: Ib735b5154325cbb658fd151f7a19dbf434ab44b7
2016-07-26 13:05:13 -04:00
Sergei Vasilinetc
f1b0e07e7f Merge "Move hwuimacro to common native benchmark infrastructure" 2016-07-19 21:33:23 +00:00
Stan Iliev
768e39335b Refactor CanvasContext: move OpenGL specific code
Move OpenGL specific code from CanvasContext into a new class
OpenGLPipeline.

Change-Id: I4363053f890701a4235927b59ec588861488ea8f
2016-07-13 14:14:12 -04:00
sergeyv
202c10b7b5 Move hwuimacro to common native benchmark infrastructure
Change-Id: I2d2b358d205b1ed950ddc9caa57360b68001893b
2016-07-12 14:36:23 -07:00
Chris Craik
5e00c7ce06 Delete old rendering pipeline
fixes: 30002246

Change-Id: I45df0e924708526cee045b14c291bd23aa1a92db
2016-07-07 15:53:50 -07:00
John Reck
f1480761c1 Benchmark-mode for macrobench
Adds googlebench output format support
Adds offscreen rendering for >60fps benchmarking
Adds 'all' alias to run all registered TestScenes

Change-Id: I2579e40f2f4c941bfbd90c75efbee384c08a116b
2016-07-06 10:50:21 -07:00
sergeyv
422e2b4829 HWUI: move microbench to APCT infrastructure
bug:29515780
Change-Id: I06f0518e2948d4268a1fa8ec99e08b5fcaaa3afd
2016-06-20 22:39:26 +00:00
sergeyv
7dc370bfe3 HWUI: add leak check for macrobench
Change-Id: Id2037921fdbe599b3c722f2e1d17b99f3b74361c
2016-06-17 14:34:22 -07:00
sergeyv
06a62f6f53 Test scene that mocks list view with text items faded on left edge.
Change-Id: I6159f02fa511241beaff4f0eb605c4f0bee360d1
2016-06-16 15:58:49 -07:00
Chris Craik
cbcc3d5c3a Merge \\\"Fix framebuffer incomplete errors\\\" into nyc-dev am: 4bcf66030d am: 7156913021
am: 22696fc0e4

Change-Id: Ib824dd0b3df68c37e3fd7ff5613b99d0687add69
2016-06-10 16:20:17 +00:00
Chris Craik
7156913021 Merge \"Fix framebuffer incomplete errors\" into nyc-dev
am: 4bcf66030d

Change-Id: I478d99bc0b1f1f10fef38505282711e95b7f5a09
2016-06-10 16:08:38 +00:00
Chris Craik
d4fe4d3b30 Fix framebuffer incomplete errors
bug:29127615

Primarily fixes case where 0 dimensioned layers could be
created/updated. Additionally, adds more logging in incomplete
framebuffer cases, if they still occur.

Change-Id: Ib90dbbafd6905aca3c8f46e64064e13a308f713d
2016-06-09 17:05:27 -07:00
Sergei Vasilinetc
0353c378ba Merge "Add gmock to hwui library" 2016-05-17 21:00:02 +00:00