bug:7093396
The functor was able to change the renderer's blend mode without it
being restored in process mode. This single path of updating gl caches
reduces likelihood of this occurring in the future.
Change-Id: Ie367532f9c683299f02bc4f635d7cb31f96db39f
A bug in software rendering caused animations on views that are offscreen
to not get drawn, therefore the animation doesn't continue (since old-style
animations depend on the logic in the drawing code to keep running). Fix is
to special case the isAnimating case in ViewRoot to go ahead and schedule
a traversal even if the dirty rect does not intersect with the visible region.
Issue #7396035 Animations starting offscreen don't draw run/end/draw properly (sw rendering only)
Change-Id: Iae25b3a424ddc5a16ba431ecd68cf42d5500db3f
Bug #7385090
This change gets rid of two silly asumptions:
- That a layer needs to be cleared with opaque black (it shouldn't,
it's already cleared to transparent and the view will cover it up
with its own background)
- The the clip should be dirty at the beginning of a frame only
when the render target is opaque
Change-Id: I415b6d3cab196057fb0281419a53fef601a44e28
A change in the VM triggers a native memory error more aggressively than before,
showing that there's a bug in the logic of recycling bitmaps. Since the pixel
memory is allocated on the Java heap, nulling out the reference to that memory
in the Java level Bitmap object can cause that memory to get collected at any time.
Meanwhile, we may have a reference to that memory at the native level for rendering
purposes, causing an error if/when we access that memory after it has been collected
by the VM.
The fix is to avoid setting the reference to the pixels to null unless we are
not referring to it in native code. This is determined at the time we call
recycle() - we return a boolean to indicate whether the native code is still
using the memory. if not, the Java code can null out the reference and allow the
VM to collect it. Otherwise, it will get collected later when the encompassing
Bitmap object is collected.
Issue #7339156 HTML5 tests crash the app (Vellamo)
Change-Id: I3a0d6b9a6c5dd3b86cc2b0ff7719007e774b5e3c
Bug #7326824
When a layer is taken out of the cache and initialized it gets cleared
to prepare it for future rendering. This triggers the following sequence
of operations:
glBindFramebuffer(layer.fbo)
attach texture storage to FBO
glClear()
glBindFramebuffer(defaultFbo)
The clear forces a resolve on tilers which stalls the CPU for a little
while, thus producing jank during animations. This change moves the
clear to the next frame when we know we will have to execute a resolve
anyway.
Change-Id: Ic1939c25df20ed65a4c48dc81ee549b2cd8b6ec3
Bug #7353771
This API can be used when scaling large images down to a small size
to get nicer looking results.
Change-Id: If09087eed36077eee5355f6047a3ca67747d7d9e
We were clamping the x/y location of the scissor to 0,0, but not adjusting
the width/height appropriately. This fix adjusts width/height and also clamps
them to 0 to correctly clip out offscreen operations.
Issue #7221524 Top left and top right portions of the screen blanks out after some time
Change-Id: I47f23336ea612409ed86652b9a68e272819ef00e
Bug #7357394
When a bitmap is reused it may change configuration which can lead
to a different pixel store alignment. Our current texture cache
implementation assumes this never happens and keeps the old alignment
which can lead to distorted texture (if the bitmap goes from
ARGB8888 to RGB565 for instance.)
Change-Id: Ic57acf2403411ae4d0924e92f221298350612617
Bug #7296475
When re-enabling the scissor the driver seems to ignore the already
existing scissor box. This change resets the scissor box when the
test state changes.
Change-Id: I3a68433164f99d21fbab769a26c56fe416c1539a
Bug #7233734
Stroked rectangles were rendered using software generated textures
which would lead to slightly misaligned results. Instead, let's use
the new convex path rendering code that will do the right thing
(and save a lot of bandwidth.)
Change-Id: Ib95ff581e56c1ecead97e4919298e6fd146ca167
bug:7260035
Adding a circle of radius 0 to a path is a no-op in skia, so detect
this case both in the PathRenderer, and in quickReject().
Change-Id: I7a172db49a5d5351b4734b39d4e4ca6379658096
When memory gets low on a device, activities flush everything they can.
Hardware-accelerated activites, such as Launcher, flush GL resources and destroy
the GL context. However, some resources were still hanging around, due to deferred
destruction policies (we don't delete layers until the DisplayLists they are in
are finalized, to ensure we don't deref deleted objects). This meant that we were
referring to obsolete GL data in these objects. in particular, it meant that we might
come around later, after a new GL context was created, and delete a texture object
that was incorrect. We use the layer's "texture id" to refer to the texture underlying the
layer. But if there's a new GL context, then this texture ID is no longer valid, and
we may be deleting the texture that a different object (layer, icon, whatever) is referring
to, because the driver may return that same ID under the new GL context.
The fix is to more aggressively delete things that we know will not be used again
when the GL context is destroyed. In particular, we delete all resources being used
by all DisplayLists at GL context destruction time.
Issue #7195815 Textures corruption on all devices, in many apps
Change-Id: I52d2d208173690dbb794a83402d38f14ea4c6c22
Bug #7253839
1. Make sure we don't make GL calls while recording display lists
2. Disable an early and trivial clip optimization in font renderer
when a perspective transformation is used on the Canvas
Change-Id: I3f1052164239329346854f72d0a0d401fbfecf06
Bug #7195815
We did not reclaim resources when reusing an existing DisplayList to
record a new empty list of commands. This would lead to various memory
leaks: bitmaps, paints, paths, matrices, etc.
This is not a common case but some apps run into this situation,
such as Launcher.
Change-Id: I2eb14ac86a212123f8edbe42b70a7c1c51fa4145
* changes:
Skia's ColorMatrix vector is in the 0..255 range not 0..1 Bug #7248980
Don't use the QCOM_tiled_rendering extension with functors Bug #7247880
Bug #7239634
This change passes two matrices to the vertex shader instead of one.
We used to compute the final MVP matrix on the CPU to minimize the
number of operations in the vertex shaders. Shader compilers are
however smart enough to perform this optimization for us. Since we
need the MV matrix to properly compute gradients dithering, this
change splits the MVP matrix into two. This has the advantage of
removing one matrix multiplication per drawing operation on the
CPU.
The SGX 540 shader compiler produces the same number of instructions
in both cases. There is no penalty hit with having two matrices
instead of one. We also send so few vertices per frame that it
does not matter very much.
Change-Id: I17d47ac4772615418e0e1885b97493d31435a936
bug:4419017
bug:7230005
- Adds support for stroke/strokeAndFill for shapes without joins
- Fixes path-polygonization threshold calculation
- Fixes rendering offset (now only used for points)
- Several formatting fixes
Change-Id: If72473dc881e45752e2ec212d0dcd1e3f97979ea
Some logic depends on a default value of 0, which was not being
assigned.
Issue #7195815 chrome url bar is corrupted
Issue #7190656 Textures corrupted on mr1
Change-Id: I346b7b76e885bf8f04740e711fd88f917a5418c7
Bug #7221449
SurfaceTexture already deletes the GL texture when detachFromContext
is invoked. The newly introduced refcount would casue the Layer
object to be destroyed later and attempt to delete the GL texture
again. By the time the second cleanup occurs, the texture name
might have been reused by somebody else, resulting in erroneous
behaviors.
Change-Id: I257c589fea64b34c00f46fbfaa7732e6854a5e41
Bug #7222476
There were two issues:
- Blending was ignored with color filters
- The addition vector of a color filter was treated as integer values
instead of float values
Change-Id: Id94065704a30ee8aaaa5724a9f3a3cff7c50ced7
Bug #7158326
When scissor optimization is enabled, OpenGLRenderer will attempt to
minimize the use of scissor by selectively enabling and disabling the
GL scissor test.
When the optimization is disabled, OpenGLRenderer will keep the GL
scissor test enabled and change the scissor rect as needed.
Some GPUs (for instance the SGX 540) perform better when changing
the scissor rect often than when enabling/disabling the scissor test
often.
Change-Id: Idb68862e287a23358f9188d577ae0f86161902fd