1346 Commits

Author SHA1 Message Date
Leon Scroggins III
0fa2bd699a DO NOT MERGE Inspect SkShader to determine hw shader.
cherry-pick of Iaa7189178bda1c55f96da044d2a9fa602ba36034

Instead of duplicating internal info about SkShader, inspect the
SkShader installed on the SkPaint.

core/java/android/view/GLES20Canvas.java:
Remove setupModifiers, nResetModifiers, and nSetupShader.

core/jni/android/graphics/Shader.cpp:
Remove calls to create/destroy the (previously) attached SkiaShader.

core/jni/android_view_GLES20Canvas.cpp:
Remove native code for setupShader and resetModifiers.

graphics/java/android/graphics/BitmapShader.java:
graphics/java/android/graphics/ComposeShader.java:
graphics/java/android/graphics/LinearGradient.java:
graphics/java/android/graphics/RadialGradient.java:
graphics/java/android/graphics/Shader.java:
graphics/java/android/graphics/SweepGradient.java:
Remove code keeping track of native SkiaShader.

libs/hwui/Caches.h:
Include Extensions.h.

libs/hwui/DeferredDisplayList.cpp:
Compare shaders on the paint, instead of on DrawModifiers.

libs/hwui/DisplayList.cpp:
libs/hwui/DisplayList.h:
Remove vector of SkiaShaders.

libs/hwui/DisplayListOp.h:
Access the SkShader on mPaint.
Remove SetupShaderOp and ResetShaderOp.

libs/hwui/DisplayListRenderer.cpp:
libs/hwui/DisplayListRenderer.h:
Remove resetShader, setupShader, refShader, and mShaderMap.

libs/hwui/FontRenderer.cpp:
Pass SkShader to setupDrawShader and setupDrawShaderUniforms.

libs/hwui/OpenGLRenderer.cpp:
libs/hwui/OpenGLRenderer.h:
Add LayerShader, a class inheriting from SkShader, to mimic the
behavior of SkiaLayerShader. Unlike SkiaLayerShader, it can be set on
the SkPaint so it can be inspected later.
Set a LayerShader instead of a SkiaLayerShader.
setupDrawShader and setupDrawShaderUniforms now inspect an SkShader
passed in.
Inspect SkShader instead of mDrawModifiers.mShader.
Remove resetShader and setupShader.
setupDrawColorUniforms now takes a boolean indicating whether there is
a shader.
Add an inline function for accessing the SkShader on an SkPaint.
In setupDrawBlending(Layer*, bool), do not check the shader (which will
never be set), but do check whether the color filter may change the
alpha (newly fixed behavior).
In setupDrawBlending(SkPaint, ...), check the SkShader and whether the
color filter affects alpha (the latter is new behavior).

libs/hwui/Renderer.h:
Remove pure virtual functions setupShader and resetShader.

libs/hwui/ResourceCache.cpp:
libs/hwui/ResourceCache.h:
Remove functions for refing/unrefing shaders.

libs/hwui/SkiaShader.cpp:
libs/hwui/SkiaShader.h:
Much of this code was redundant and has been removed.
Convert structs into class with nothing but static functions for
calling describe/setupProgram.

libs/hwui/TextureCache.cpp:
libs/hwui/TextureCache.h:
Use the SkPixelRef as the key to the bitmap Lru cache, since shader
inspection will provide a different SkBitmap pointer (though it will
hold the correct SkPixelRef with the correct generation ID).

tests/CanvasCompare/src/com/android/test/hwuicompare/DisplayModifier.java:
tests/CanvasCompare/src/com/android/test/hwuicompare/ResourceModifiers.java:
Update manual test to have more shaders: radial, sweep, compose,
invalid compose.

BUG:10650594
Change-Id: I2e7182b3fc28268e7ca82fac6780540b6b45365c
2014-05-23 11:50:38 -04:00
Chris Craik
b8fe2fcd71 Merge "Define light position (using new lighting spec) in Java" 2014-05-22 00:18:21 +00:00
Chris Craik
797b95b26b Define light position (using new lighting spec) in Java
Also updates the relative shadow strengths.

Change-Id: I6cac7275d38df98aea9f0dda463cd7207102986a
2014-05-21 13:50:29 -07:00
Chris Craik
61317325b7 Disable shadow drawing for empty/null outlines
Change-Id: I60d0f326cfab97d88c49d17cf32e619b5e60b94a
2014-05-21 13:04:10 -07:00
Chris Craik
f2985ba3f4 Merge "Correct viewport initialization, bounds comparison" 2014-05-19 21:54:03 +00:00
Chris Craik
50b843883d am 3c769ec0: am 00fabcbe: am b1708e9b: Merge "Use alpha channel instead of red in drawCachedGlyphBitmap"
* commit '3c769ec02b8b82bec4dec2169bf76af58be94a9a':
  Use alpha channel instead of red in drawCachedGlyphBitmap
2014-05-19 19:35:59 +00:00
Chris Craik
3c769ec02b am 00fabcbe: am b1708e9b: Merge "Use alpha channel instead of red in drawCachedGlyphBitmap"
* commit '00fabcbeb035fb513293ea01d245002f40b3234f':
  Use alpha channel instead of red in drawCachedGlyphBitmap
2014-05-19 19:32:38 +00:00
Chris Craik
00fabcbeb0 am b1708e9b: Merge "Use alpha channel instead of red in drawCachedGlyphBitmap"
* commit 'b1708e9b764268a06d91219a5c39ee9efd32ab00':
  Use alpha channel instead of red in drawCachedGlyphBitmap
2014-05-19 19:27:52 +00:00
Ben Cheng
1a49868fd8 Use default visibility for Snapshot::getLocalClip (attempt #2).
The change appeared to be dropped.
See commit 65ba94f79d6e737c3e66c09032221999b2eb50d7 for details.

Change-Id: Ib60968d6327ef04d21e4adca2c394f66343f204b
2014-05-17 15:37:26 -07:00
Alan Viverette
ad2f8e334f Update ripple behavior, use render thread animation
Change-Id: Ib6bc1e08b05d29606f452961963d58b8fc866746
2014-05-16 13:28:33 -07:00
Chris Craik
c9ee304c91 Merge "Round rect outline clipping" 2014-05-16 00:37:29 +00:00
Chris Craik
deeda3d337 Round rect outline clipping
Change-Id: Iee9cf4f719f6f1917507b69189ad114fa365917b
2014-05-15 16:36:12 -07:00
Chris Craik
924197513a Correct viewport initialization, bounds comparison
Change-Id: Ibd751856e3712991e149800ed179464397dad7c3
2014-05-15 13:21:28 -07:00
John Reck
ff941dcd81 Animator start value...
Change-Id: Ifd35ed95a28c625086d7fa97764fe63ab4a997f1
2014-05-15 08:53:39 -07:00
Digish Pandya
c62c1cc17d Use alpha channel instead of red in drawCachedGlyphBitmap
the correct value to copy in bitmap is alpha component from
the cachebuffer. currently it is offset to red channel if format is
RGBA which is wrong.

this is followup fix for https://android-review.googlesource.com/#/c/93943/

Change-Id: I96b5ba35df5ccaef44caf2542d35d6585ba1df80
Signed-off-by: Digish Pandya <digishp@codeaurora.org>
2014-05-15 08:59:22 +05:30
Chris Craik
fe4c1e225d Merge "Combine projection matrix, and viewport management" 2014-05-15 02:01:14 +00:00
Chris Craik
96f266ee5d Merge "Remove Path based outline clipping" 2014-05-15 02:00:36 +00:00
Chris Craik
2bcad17675 Remove Path based outline clipping
Change-Id: Ic5ccd98a7517b46e768e53d6b0c8fdcda305fb2c
2014-05-14 18:11:23 -07:00
Chris Craik
a64a2bef10 Combine projection matrix, and viewport management
Merge management of ortho projection matrix with the viewport size,
since they should always be changed together.

Change-Id: Iccb8f30828f4fb7848999ac54852e7ed2d6f2eb1
2014-05-14 17:27:52 -07:00
John Reck
3eb9882a67 Merge "Disable texture atlas" 2014-05-14 23:59:14 +00:00
John Reck
cdfeef6624 Disable texture atlas
Bug: 14952384

Change-Id: If38b3e4c08c2c3dd9c00ae9e6e8c10e208e737d1
2014-05-14 23:59:01 +00:00
ztenghui
a6464b38fc Merge "Check the array before accessing it" 2014-05-14 23:15:22 +00:00
ztenghui
f11310f395 Check the array before accessing it
TODO: Figure out why the path is generating empty polygon.

bug: 14615368

Change-Id: If116e34388b7c6a71bf5ddd36e0c9716d7450732
2014-05-14 21:02:45 +00:00
John Reck
bee74c2b47 Merge "Clamp to uint8 for alpha" 2014-05-13 21:59:36 +00:00
John Reck
66f0be65a1 Wire up texture atlas
Bug: 14590563

Change-Id: I2dffbc089dc801f5fb2d1c8fd38e1c71d160e110
2014-05-13 14:54:42 -07:00
John Reck
531ee701dd Clamp to uint8 for alpha
Change-Id: Id3e51671297bfb879969ad2fe7a5741dd4cf4c29
2014-05-13 10:06:08 -07:00
John Reck
c8ac775659 More native interpolators
Gotta collect 'em all

Change-Id: I3ccc2b5c842b27b906c8a0470fbedc2bf285bc38
2014-05-12 16:42:02 -07:00
John Reck
315c329544 Add TimeInterpolator support to RNA
Bug: 14678626

Change-Id: I6554e7fcd42c49fac3618ca792083bb68e358f55
2014-05-12 14:41:06 -07:00
Jorim Jaggi
ddc52285ca Revert "Simplify projection matrix management."
This reverts commit 0efaa71d5414287ed4beac0a88cf76f7e33a1e74.
2014-05-11 16:16:17 +02:00
Chris Craik
2417f7e08c Merge "Simplify projection matrix management." 2014-05-09 23:55:25 +00:00
John Reck
c42bfb95c6 Merge "Refactor VirtualLightRefBase & JNI" 2014-05-09 23:18:26 +00:00
Chris Craik
0c0ec26366 Simplify projection matrix management.
Store in and use from snapshot, and remove the kFlagOrthoDirty flag,
as it's redundant with kFlagIsFboLayer.

Change-Id: I2bd380192d50117f4ce1fd2058213669a886f406
2014-05-09 16:11:14 -07:00
John Reck
9fa4071c47 Refactor VirtualLightRefBase & JNI
Change-Id: I8e244e7109e59d5be96871b23bb9b1201c7f9eaa
2014-05-09 15:28:54 -07:00
Chris Craik
f9075798d7 am 90eaf92e: am 7e13d1d4: am f6c9c420: Merge "Correct stride for drawing to cached glyph bitmap"
* commit '90eaf92e325457ccb30286879a2f92b7ba517c7d':
  Correct stride for drawing to cached glyph bitmap
2014-05-09 22:00:02 +00:00
Chris Craik
90eaf92e32 am 7e13d1d4: am f6c9c420: Merge "Correct stride for drawing to cached glyph bitmap"
* commit '7e13d1d4a46a01ebaa412d622ef76d90bd39d12a':
  Correct stride for drawing to cached glyph bitmap
2014-05-09 21:51:49 +00:00
Chris Craik
7e13d1d4a4 am f6c9c420: Merge "Correct stride for drawing to cached glyph bitmap"
* commit 'f6c9c4204c2f8f86277d081112c9dd863ddaa778':
  Correct stride for drawing to cached glyph bitmap
2014-05-09 21:46:43 +00:00
Chris Craik
e1f788b3e2 Merge "Rename matrices for consistency" 2014-05-09 18:02:53 +00:00
Digish Pandya
b9312a54e4 Correct stride for drawing to cached glyph bitmap
fixes the glyph cachebuffer index to account for pixelbuffer
format size.

issue: in launcher home screen create icon group and rename the
group to some text string with emo-icons (smilies). without this
change the drop shadows for emo-icons will look bad.

Change-Id: I525a9219d35f4541363fd64e7fc5fd1053269725
Signed-off-by: Digish Pandya <digishp@codeaurora.org>
2014-05-09 15:05:16 +05:30
Chris Craik
e10e827ed6 Rename matrices for consistency
The projection matrix no longer contains viewing transformation, and
has thus been renamed.

Change-Id: I4f85ccdac97f4cb4f987bb05c389816680f1c94f
2014-05-08 14:28:26 -07:00
Chris Craik
e4aa95e362 Add logging utility methods
Change-Id: I0f316830dcc0bbf438292a6d0fbe9f8154368500
2014-05-08 13:57:05 -07:00
Derek Sollenberger
5b554f0103 Merge "Avoid caching shadow properties in Java & HWUI." 2014-05-08 14:41:47 +00:00
John Reck
ef27453cf7 Merge "Cleanup attachFunctor" 2014-05-07 21:48:20 +00:00
John Reck
832b151465 Cleanup attachFunctor
Bug: 13961296

Change-Id: Id48d11bfcc234afd1fd7e4fdd409a50e7208c81d
2014-05-07 14:39:44 -07:00
John Reck
b6d9211d31 Merge "Implement TODO(romainguy)" 2014-05-07 21:24:25 +00:00
John Reck
63a0667325 Implement TODO(romainguy)
Bug: 14277445

Change-Id: Id52d6f7fcc023000adcc440bd4da67d9a673536b
2014-05-07 13:45:54 -07:00
John Reck
368cdd8526 Don't try to draw if there's no canvas or surface
Bug: 14616376

 doFrame() can happen after the canvas or surface is destroyed,
 handle it gracefully

Change-Id: Ibbbbdbfa77fa2134bd2abc215ca1a0886d706969
2014-05-07 13:19:28 -07:00
Derek Sollenberger
c29a0a4664 Avoid caching shadow properties in Java & HWUI.
bug: 10650594
Change-Id: I6f57df002710bb0567ed7e53fc0bfe96cfd504b8
2014-05-07 09:36:04 -04:00
John Reck
ebb9e69513 Merge "Implement loadSystemProperties" 2014-05-06 16:17:13 +00:00
John Reck
e4280baaa7 Implement loadSystemProperties
Bug: 14087580

Change-Id: I7153f38c70b554a78c56a0e794da929fc401ee7a
2014-05-05 16:39:37 -07:00
Chris Craik
81997fef18 am 3cb74d21: am 5d8343b8: am a85db5ab: Merge "libhwui: Handle the blurImage() implement once RS::init fail"
* commit '3cb74d21b2ac2427e805f72a113e8d7a2cc460f3':
  libhwui: Handle the blurImage() implement once RS::init fail
2014-05-05 21:53:56 +00:00