18 Commits

Author SHA1 Message Date
Steve Block
5baa3a62a9 Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
2012-01-03 22:38:27 +00:00
Romain Guy
2d4fd36484 Reduce the number of active texture changes
Change-Id: I94046bdfe20740c26c8183822e3002d692fde7c4
2011-12-13 22:00:19 -08:00
Romain Guy
f3a910b423 Optimize state changes
Change-Id: Iae59bc8dfd6427d0967472462cc1994987092827
2011-12-12 20:35:21 -08:00
Romain Guy
3e263fac8c Keep shaders to render properly
I don't know who's to blame, SGX or Tegra2 but one of those two GPUs is not
following the OpenGL ES 2.0 spec.

Change-Id: I2624e0efbc9c57d571c55c8b440a5e43f08a54f2
2011-12-12 16:47:48 -08:00
Romain Guy
05bbde70fd Free up resources by deleting shaders early on
Change-Id: I29a39775732c0a48d3e6823f7afa3e741cae8541
2011-12-09 12:55:37 -08:00
Chet Haase
8a5cc92a15 Fix various hw-accelerated line/point bugs
All accelerated lines are now rendered as quads. Hairlines used to
be rendered as GL_LINES, but these lines don't render the same as our
non-accelerated lines, so we're using quads for everything. Also, fixed
a bug in the way that we were offsetting quads (and not offseting points)
to ensure that our lines/points actuall start on the same pixels as
Skia's.

Change-Id: I51b923cc08a9858444c430ba07bc8aa0c83cbe6a
2011-04-27 14:23:29 -07:00
Romain Guy
67f27952c1 Correctly release the OpenGL Canvas on EGL error.
Change-Id: Ib31fd8445f7ce5f7aa7e0205de0e7db80d024fc2
2010-12-07 20:12:50 -08:00
Romain Guy
5b3b35296e Optimize FBO drawing with regions.
This optimization is currently disabled until Launcher is
modified to take advantage of it. The optimization can be
enabled by turning on RENDER_LAYERS_AS_REGIONS in the
OpenGLRenderer.h file.

Change-Id: I2fdf59d0f4dc690a3d7f712173ab8db3848b27b1
2010-11-02 16:17:23 -07:00
Romain Guy
707b2f78cc Optimize GLSL shaders.
Change-Id: I9a5e01bced63d8da0c61330a543a2b805388a59d
2010-10-11 16:34:59 -07:00
Romain Guy
889f8d1403 Moved all the rendering code to the new shader generator.
The generator supports features that are not yet implement in the
renderer: color matrix, lighting, porterduff color blending and
composite shaders.

This change also adds support for repeated/mirrored non-power of 2
bitmap shaders.

Change-Id: I903a11a070c0eb9cc8850a60ef305751e5b47234
2010-07-29 14:37:42 -07:00
Romain Guy
ac670c0433 Generate shaders to cover all possible cases.
With this change, all the vertex and fragment shaders used by the GL
renderer are now generated based on a program description supplied
by the caller. This allows the renderer to generate a large number
of shaders without having to write all the possible combinations by
hand. The generated shaders are stored in a program cache.

Change-Id: If54d286e77ae021c724d42090da476df12a18ebb
2010-07-27 19:52:29 -07:00
Romain Guy
694b519ac6 Add text rendering.
Change-Id: Ibe5a9fa844d531b31b55e43de403a98d49f659b9
2010-07-21 21:33:20 -07:00
Romain Guy
c0ac193b94 Add support for linear gradients.
Change-Id: Id15329da065045b3f06fdaed615f33cd57608496
2010-07-19 18:44:05 -07:00
Romain Guy
f9764a4f53 Add program for linear gradient.
This change adds a new DrawLinearGradientProgram class to enable the drawing
of linear gradients. Two new vertex and fragment shaders are introduced,
based on DrawTextureProgram's shaders.

Change-Id: I885afc076bb6cef8cd3962ae21a086fa6a03bf96
2010-07-16 23:18:27 -07:00
Romain Guy
6926c72e25 Correctly support pre-multiplied alpha, optimizations, more stuff.
Add support for the following drawing functions:
- drawBitmap(int[]...)
- drawPaint()

Optimizes shader state changes by enabling/disabling attribute arrays
only when needed.

Adds quick rejects when drawing trivial shapes to avoid unnecessary
OpenGL operations.

Change-Id: Ic2c6c2ed1523d08a63a8c95601a1ec40b6c7fbc9
2010-07-12 20:20:03 -07:00
Romain Guy
260e102162 Optimize shader binding changes.
This change also cleans up the internal API a little bit by using mat4
everywhere instead of float[16] (for the ortho matrix for instance.)

Change-Id: I35924c7dc17bad17f30307118d5ed437c2ed37e0
2010-07-12 14:43:40 -07:00
Romain Guy
0b9db91c3d Remove math from the vertex shader.
Change-Id: I02847a60a8734bf8b3d29ec12e76297795095e38
2010-07-09 18:53:25 -07:00
Romain Guy
5cbbce5357 Reduced the complexity of layers composition.
This change also refactors the code base a bit by moving classes out of
OpenGLRenderer into separate headers/implementations. This makes the code
more manageable.

This change also adds documentation for implementation methods. The
undocumented methods are simply Skia's Canvas methods.

Change-Id: I54c68b443580a0129251dddc1a7ac95813d5289e
2010-06-27 22:59:20 -07:00