summaryrefslogtreecommitdiffstats
path: root/libs/hwui/OpenGLRenderer.h
Commit message (Collapse)AuthorAgeFilesLines
* Skip eglSwapBuffers() call when we do not draw to GLChet Haase2012-05-311-21/+21
| | | | | | | | | | The fix is to track when we issue GL drawing commands, and to skip the call to eglSwapBuffers() when a DisplayList does not result in any actual rendering calls to GL. Issue #6364143 QuickMuni list items and buttons flicker instead of fade Change-Id: I60a02c61a58c32d92481a1e814b4c8a49c6a37a3
* Ensure we always set the proper blending modeRomain Guy2012-05-221-0/+6
| | | | | | | | | | Bug #6527305 At the beginning of a frame, always set the blending mode that we think GL is using just in case it was modified by another entity (for instance a WebView functor.) Change-Id: I0e1d0abee8a2abb2b8e7622aed28346e89562c06
* Sanitize display list propertiesRomain Guy2012-05-181-1/+1
| | | | | | | | | | | The comparisons used in the various properties setters could fail badly in some specific conditions. The scale properties in particular did not use the same comparisons. This change also clamps alpha to the 0..1 range which avoids overflow issues with lowp registers in GLSL computations. Change-Id: I3e73b584e907a14e2c33d0865ca0d2d4d5bff31d
* Avoid unnecessary copy when invoking drawBitmap(int[])Romain Guy2012-05-151-0/+2
| | | | | | Bug #6483390 Change-Id: I4d2d725ef50c9401b4bd998b6160128102b40745
* Remove all Dalvik allocations from Cavnas.drawBitmap(int[], ...)Romain Guy2012-05-141-0/+1
| | | | Change-Id: Ie28538a2104d21154fdc78a56525e7403f08287d
* Prevent WebView from crashing when detached from the windowRomain Guy2012-04-231-1/+4
| | | | | | | | | | | | | Bug #6365056 WebView enqueues a functor in the hardware renderer to handle animations and this functor is called at a later time by the hardware renderer. However, the functor was not removed from the queue when WebView was removed from the window. This could cause the hardware renderer to attempt to execute an invalid functor and lead to a crash. Change-Id: I9d38e80f3fdc5e29d4d0cdfa1e893c251a954508
* Remove USE_DISPLAY_LIST_PROPERTIES flagChet Haase2012-04-231-2/+2
| | | | | | | | | | | | | | | | This flag was still hanging around pending any need to disable DisplayList properties. But things seem stable, so it's time to clean up and simplify the code. At the same time, I reduced redundance in DisplayList dimensions. We used to call drawDisplayList() with width/height parameters that were used to do a clip reject. This is redundant with the DisplayList properties that set the bounds of the DisplayList; the left/right and top/bottom properties represent the same width/height properties formerly used in drawDisplayList(). The new approach is to not pass dimensions to drawDisplayList(), but to instead pull those dimensions directly from the DisplayList when needed. Change-Id: I8871beff03b1d4be95f7c6e079c31a71d31e0c56
* Fix layer blending bugChet Haase2012-04-121-0/+1
| | | | | | | | | | Cached layers were sometimes retaining an obsolete blending value, causing artifacts where translucent objects were disappearing completely. Also, added extra tracing info for DisplayLists. Issue #6303668 Flickering views during SwipeHelper drag Change-Id: I66ce158652c4a3ed316040585b40b1744e1fad0c
* Merge "Disable AA lines vertex attrib arrays after rendering"Romain Guy2012-04-041-1/+2
|\
| * Disable AA lines vertex attrib arrays after renderingRomain Guy2012-04-041-1/+2
| | | | | | | | Change-Id: I2f035e9d87f4f97bc1e37355c84570fd58df0374
* | Optimization of alpha with DisplayList propertiesChet Haase2012-04-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Some views (such as ImageView and TextView) handle non-opaque alpha values directly. This was originally an optimization, but we can handle it faster in many cases without this optimization when DisplayList properties are enabled. Basically, if a view has non-overlapping rendering, we set the alpha value directly on the renderer (the equivalent of setting it on the Paint object) and draw each primitive with that alpha value. Doing it this way avoids re-creating DisplayLists while getting the same speedup that onSetAlpha() used to get pre-DisplayList properties. Change-Id: I0f7827f075d3b35093a882d4adbb300a1063c288
* | Allow fine-grained control over functors executionRomain Guy2012-04-021-2/+5
|/ | | | | | Adds non-drawing execution mode Change-Id: I82f92cf1b9a3b9ff2ca6d7427c4e02b73e04e6bf
* Use a status_t return type for GL functorsRomain Guy2012-03-261-2/+2
| | | | | | | | | WebView needs more fine-grained control over the behavior of the framework upon execution of the display lists. The new status_t allows WebView to requests its functor to be re-executed directly without causing a redraw of the entire hierarchy. Change-Id: I97a8141dc5c6eeb6805b6024cc1e76fce07d24cc
* Add hooks to implement Canvas.drawTextOnPath() in GLRomain Guy2012-02-241-2/+4
| | | | Change-Id: I165c9e05facf5365aa6850605688e538640c7fcc
* Record possible clip rejects when recording display listsRomain Guy2012-02-171-1/+1
| | | | | | | | | | | This optimization allows us to quickly skip operations that lie entirely outside of the known bounds of a display list. Because of ViewGroup.setClipChildren, we must keep the operations recorded in the display list. setClipChildren(false) is however a very uncommon operation and we will therefore often benefit from this new optimization. Change-Id: I0942c864e55298e6dccd9977d15adefbce3ba3ad
* Add debug markers to OpenGLRendererRomain Guy2012-01-301-0/+3
| | | | | | | | These markers will be used to group the GL commands by View in the OpenGL ES debugging tool. This will help correlate individual GL calls to higher level components like Views. Change-Id: I73607ba2e7224a80ac32527968261ee008f049c6
* Add stencil buffer to the EGL configRomain Guy2012-01-301-0/+2
| | | | Change-Id: If76c0cd6127534d90f9526b75c0f8e56259c6722
* Add full support for Canvas.setDrawFilter()Romain Guy2012-01-231-0/+11
| | | | Change-Id: I0ad35d0603c4eeda469014803be14c1dcdde918c
* First pass at implementing Canvas.drawPosText() in GLRomain Guy2012-01-171-0/+2
| | | | Change-Id: Ia3ac347e95d57eb86c63045156c8dbc0572b03cb
* Reduce the number of GL commands generated by the UIRomain Guy2011-12-131-2/+2
| | | | | | | | This optimization along with the previous one lets us render an application like Gmail using only 30% of the number of GL commands previously required Change-Id: Ifee63edaf495e04490b5abd5433bb9a07bc327a8
* Faster text clippingRomain Guy2011-12-011-1/+1
| | | | Change-Id: I03a00c4261d81a416b1ad7b86ce2d432c71908b4
* Reduce the size of libhwui by 50%Romain Guy2011-10-121-6/+8
| | | | | | | | This change removes unnessary symbols. All symbols are hidden by default, public APIs with exported symbols are explicitly marked with ANDROID_API. Change-Id: I692fde432a86c12108de1cfd1f6504919a7d5f3f
* Remove unnecessary private APIRomain Guy2011-08-111-1/+0
| | | | Change-Id: I2ecb367528ec0691c07153a3d163b82a6ca33fdf
* Improve rendering performance on some GPUsRomain Guy2011-07-251-6/+0
| | | | | | | | This change sets textures filtering to GL_NEAREST by default. GL_LINEAR filtering is only used when textures are transformed with a scale or a rotation. This helps save a couple of fps on some GPUs. Change-Id: I1efaa452c2c79905f00238e54d886a37203a2ac1
* Add TextureView.getBitmap()Romain Guy2011-06-141-8/+8
| | | | | | | This API can be used to get a Bitmap copy of the content of a TextureView. Change-Id: I07522216c353720fba5cab333174f58f484eb911
* Batch glCopyTexImage() calls to get about 15 fps back on SGX.Romain Guy2011-06-131-1/+67
| | | | Change-Id: I04079e070739c1e46df3e90fc388c335e2a7d2b9
* Add support to OpenGLRendere to draw BiDi text.Romain Guy2011-06-011-2/+0
| | | | | | Bug #4350336 Change-Id: I1cf31693f7ca9653fa3a41b5b91c27ef288d680f
* Fix issue with drawColor(color, Mode.Clear)Romain Guy2011-05-271-0/+1
| | | | Change-Id: I486b24a5b609c6f8adb0276037ddb24af2b888b2
* Merge "Prepare OpenGLRenderer to use glyphs from TextLayoutCache"Fabrice Di Meglio2011-05-131-0/+2
|\
| * Prepare OpenGLRenderer to use glyphs from TextLayoutCacheFabrice Di Meglio2011-05-131-0/+2
| | | | | | | | | | | | | | - add OpenGLRenderer.drawGlyph() - refactor glypth logging code Change-Id: I797e6f1304d3f3f8f6ed31e7f9965d336233d2a4
* | Antialiasing for rectanglesChet Haase2011-05-121-0/+3
|/ | | | Change-Id: I7ca6931606541ddd504bd5db7f8dc04b9cde8cd9
* Add ability for hierarchyviewer to output displaylist infoChet Haase2011-05-051-0/+1
| | | | | | | | | Clicking on a node in hierarchyviewer1 and hierarchyviewer2 and then clicking the new "Dump DisplayList" button will cause the display list for the selected node (including its children) to be output into logcat. Change-Id: Iad05f5f6cca0f8b465dccd962b501dc18fe6e053
* Revert "Add ability for hierarchyviewer to output displaylist info"Chet Haase2011-05-041-1/+0
| | | | This reverts commit b2a4b52e8d5e499d33e2765e8c47851bf0266299.
* Add ability for hierarchyviewer to output displaylist infoChet Haase2011-05-041-0/+1
| | | | | | | | | Clicking on a node in hierarchyviewer1 and hierarchyviewer2 and then clicking the new "Dump DisplayList" button will cause the display list for the selected node (including its children) to be output into logcat. Change-Id: Id32f62569ad1ab4d533bc62987f3a7390c1bb4e6
* Merge "Allows to render with an OpenGL context inside a TextureView."Romain Guy2011-05-021-1/+2
|\
| * Allows to render with an OpenGL context inside a TextureView.Romain Guy2011-05-021-1/+2
| | | | | | | | Change-Id: I59453f7fc3997f0502a1c5d325d37fed376fabc7
* | Line endcaps for AA lines are now antialiased.Chet Haase2011-05-021-1/+2
|/ | | | | | Also fixed other minor issues with AA and line rendering. Change-Id: Icd4638d27c70e2ee0f28b5d9a2b97d8b29e8ac4d
* Merge "New widget: TextureView Bug #4343984"Romain Guy2011-04-281-0/+13
|\
| * New widget: TextureViewRomain Guy2011-04-281-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug #4343984 TextureView can be used to render media content (video, OpenGL, RenderScript) inside a View. The key difference with SurfaceView is that TextureView does not create a new Surface. This gives the ability to seamlessly transform, animate, fade, etc. a TextureView, which was hard if not impossible to do with a SurfaceView. A TextureView also interacts perfectly with ScrollView, ListView, etc. It allows application to embed media content in a much more flexible way than before. For instance, to render the camera preview at 50% opacity, all you need to do is the following: mTextureView.setAlpha(0.5f); Camera c = Camera.open(); c.setPreviewTexture(mTextureView.getSurfaceTexture()); c.startPreview(); TextureView uses a SurfaceTexture to get the job done. More APIs are required to make it easy to create OpenGL contexts for a TextureView. It can currently be done with a bit of JNI code. Change-Id: Iaa7953097ab5beb8437bcbbfa03b2df5b7f80cd7
* | Fix various hw-accelerated line/point bugsChet Haase2011-04-271-14/+1
|/ | | | | | | | | | | 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
* Enable anti-aliasing for hw-accelerated linesChet Haase2011-04-211-0/+16
| | | | | | | Draw anti-aliased lines with OpenGL by constructing a quad with a border that fades out (to mimic fragment coverage). Change-Id: Ib81a3e62d663acdf1b46b401ac4aa7ee9855cc7e
* Add support for drawPoint() and drawPoints().Romain Guy2011-03-211-0/+3
| | | | Change-Id: I01bef50c08ec3160f8d40dc060b2cf6c2e4d7639
* Correctly apply filters to Alpha8 bitmaps.Romain Guy2011-03-181-0/+2
| | | | | | This change also removes unnecessary operations from display lists. Change-Id: I627f85861982731f0ee7705b48b36d9c56f22f39
* Fix rendering artifact in edge fades.Romain Guy2011-03-141-10/+2
| | | | | | | | | | | | | | | | | | 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
* Add support for partial invalidates in WebViewRomain Guy2011-03-071-2/+2
| | | | | | | | | | | | 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
* Update layers based on the dirty region.Romain Guy2011-02-011-0/+2
| | | | | | | | | Bug #3413433 This helps Launcher when a widget updates during a scroll, or when interacting with widgets on the workspace if layers are still turned on. Change-Id: Ic7a42eb34f74f4ae988039754f815e2efd1d1e4f
* Remove unused APIRomain Guy2011-01-261-2/+0
| | | | Change-Id: I1714fd82a64b752f0350ef4ef9179ce19e089c6a
* Enable partial invalidates when rendering with OpenGL.Romain Guy2011-01-241-1/+2
| | | | Change-Id: Ie8be06c4776b815e8737753eb8003b4fd8936130
* Use optimized display lists for all hwaccelerated renderingChet Haase2011-01-241-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, display lists were used only if hardware acceleration was enabled for an application (hardwareAccelerated=true) *and* if setDrawingCacheEnabled(true) was called. This change makes the framework use display lists for all views in an application if hardware acceleration is enabled. In addition, display list renderering has been optimized so that any view's recreation of its own display list (which is necessary whenever the visuals of that view change) will not cause any other display list in its parent hierarchy to change. Instead, when there are any visual changes in the hierarchy, only those views which need to have new display list content will recreate their display lists. This optimization works by caching display list references in each parent display list (so the container of some child will refer to its child's display list by a reference to the child's display list). Then when a view needs to recreate its display list, it will do so inside the same display list object. This will cause the content to get refreshed, but not the reference to that content. Then when the view hierarchy is redrawn, it will automatically pick up the new content from the old reference. This optimization will not necessarily improve performance when applications need to update the entire view hierarchy or redraw the entire screen, but it does show significant improvements when redrawing only a portion of the screen, especially when the regions that are not refreshed are complex and time- consuming to redraw. Change-Id: I68d21cac6a224a05703070ec85253220cb001eb4
* Add support for arcs.Romain Guy2011-01-231-0/+2
| | | | Change-Id: I96c057ff4eb1b464b03f132da0b85333777bee4f