Bug #4092053
The problem always existed but was made visible by partial invalidation.
When saving a layer, the renderer would try to postpone glClear()
operations until the next drawing command. This however does not work
since the clip might have changed. The fix is rather simple and
simply gets rid of this "optimization" (that turned out to be
usless anyway given how View issues saveLayer() calls.)
This change also fixes an issue with gradients (color stops where
not properly computed when using a null stops array) and optimizes
display lists rendering (quickly rejects larger portions of the
tree to avoid executing unnecessary code.)
Change-Id: I0f5b5f6e1220d41a09cc2fa84c212b0b4afd9c46
Bug #3461349
This change also fixes two bugs that prevented partial invalidates
from working with other views. Both bugs were in our EGL implementation:
they were preventing the caller from comparing the current context/surface
with another context/surface. This was causing HardwareRenderer to always
redraw the entire screen.
Change-Id: I33e096b304d4a0b7e6c8f92930f71d2ece9bebf5
Bug #3413433
This change will be beneficial to Launcher to avoid hiccups when
swiping pages of icons. When a layer is discarded, it is kept
in the layers pool instead of being destroyed right away. This
favors memory reuse over allocations.
Change-Id: Ifb6944ba83d6ceb67c331527c0827b26ce648eb1
Bug #3413433
Launcher now enables layers all the time, but in some cases (for instance, when the
workspace is not scrolling,) it is more efficient to draw without the layer.
Change-Id: I625fb5b48506acda9ae75356fdbbe812c85f2aab
With this new backend, a hardware layer is only recreated when
its associated view is udpated. This offers fast composition
in GL and fast update of the layer in GL as well.
Change-Id: I97c43a612f5955c6bf1c192c8ca4af10fdf1d076
This change detects what area of a layer was drawn into and generates a mesh
to match this area exactly. This can be used to avoid blending empty pixels
when the layer is composited.
This change also adds proper layers support to lines rendering and implements
layers composition in a more readable way.
Change-Id: I4a5588b98b19bd66891ebdc39631b193c5e31999
This API can be used to back a view and its children with either a
software layer (bitmap) or hardware layer (FBO). Layers have
various usages, including color filtering and performance
improvements during animations.
Change-Id: Ifc3bea847918042730fc5a8c2d4206dd6c9420a3
Layers require that drawing methods potentially
draw in more than one bitmaps.
To handle this this patch offers the following:
- move all drawing methods to use Drawable
- Drawables are now handled by GcSnapshot since
its the one handling the layers
- moved Canvas_Delegate.createCustomGraphics to
GcSnapshot which does not expose the Graphics2D
objects anymore so its draw() methods are the only
way to draw.
- handles creating layers in GcSnapshot.save() and
blitting them in restore()
Other changes:
- Clean up the create/save API in GcSnapshot
- Fixed drawing bitmaps with alpha and other
composite modes.
Change-Id: I1e230087493d044a10de71f4b6d29083e3f3bf64
- always set up the stroke. Paint may not have the proper
style when drawing lines. stroke should still be setup.
- Fixed vertical linear gradient. Old code generated
a gradient ratio of NaN
- Fixed alpha rendering when using shaders. In that
case the alpha channel from the paint color should be
used in conjunction with the shader.
- Fixed miter limit. Java expects the value to be multiplied
by the stroke width
- Fixed support for drawing ALPHA_8 bitmaps. Java2D doesn't
have bitmaps with only alpha channels, so we keep using
ARGB bitmaps but when drawing them into a bitmap we erase
the color information.
Change-Id: I4f04341fc843e3f7dadd1fdbf709b11a4f1e24b9
Also created delegates for all missing shader, xfermode
and patheffect classes. Moved the logic of the xfermode,
and patheffects that was in Canvas_Delegate into the
xfermode/patheffect classes, and added support (in all
3 clases) for knowing if the shader/xfermode/patheffect
is actually supported or not. Make use of fidelityWarning
in LayoutLog if they are not.
The goal is use the app to test layout lib, so layout
files are needed, and custom views must be instantiable
(ie public)
Change-Id: I46bb3d8af6e4d7973d041aa618f1c7762efd93d0
This fixes only linear gradients. Sweep and radial gradients, as well as
bitmap shaders, will be fixed in a future commit.
Change-Id: I4eee4ff62e9bbf3b9339fc111a780167449ecfef
This change is a workaround for a driver bug that causes an INVALID_OPERATION
to be thrown on every glCopyTexSubImage() call. This change also adds a new
test for gradients local matrices.
Change-Id: I41b7437481026702d0a3a9677f099b4557c0a84e
This change also adds full support for local transformation matrices on
sweep and radial gradients.
Change-Id: Id8773bc0766575190e3f3d51984fc5e57b266c3f
This adds the ability to blend with the framebuffer using Darken,
Lighten, Add, Multiply, Overlay and Screen.
Change-Id: Iae01a53797d4ad39c373cba6ff2a42293129da1a