summaryrefslogtreecommitdiffstats
path: root/libs/hwui/LayerRenderer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Unflip TextureView getBitmap readbackChris Craik2015-05-221-8/+0
| | | | | | bug:20165725 Change-Id: I09035f43be140145c54221d6865206ce486994c9
* Constructor cleanupChris Craik2015-03-021-3/+0
| | | | Change-Id: Ic39911d08f44c3174de91fb92fcd4cab73fe4654
* Fix glop rendering within unclipped saveLayersChris Craik2015-02-271-1/+1
| | | | | | | | | bug:19541881 Additionally, clean up GlopBuilders and rename onGetSnapshot() for clarity Change-Id: I0303e4cd61eef87cf80af2d968c4aa67193cd008
* Glop TextureLayer supportChris Craik2015-02-271-2/+3
| | | | Change-Id: I348a926bd4a2f47be9fdbe74058c0aa2f8dc6276
* Glop layer mesh renderingChris Craik2015-02-191-1/+1
| | | | Change-Id: I2d902819d5d77f496b67d4d25a298782903e410d
* Glop ColorFilter & VertexBuffer support, initial enableChris Craik2015-02-061-1/+1
| | | | | | | Enables Glop rendering for supported Rects and VertexBuffers Also removes unused Query object Change-Id: Ibe227bc362685a153159f75077664f0947764e06
* Refactor blending and texture gl stateChris Craik2015-01-301-5/+5
| | | | Change-Id: Ia6b3c8b2afd3dfcee7f3ce401d846b789612054a
* Move scissor state to RenderStateChris Craik2015-01-271-9/+10
| | | | Change-Id: I1227a3886fb24e4d9fad79fca469794f06cfb15e
* Add overrides and switch to nullptr keyword for all filesChris Craik2015-01-051-11/+11
| | | | | | | Adds remaining missing overrides and nullptr usages, missed due to an extreme failure in tool usage. Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
* resolve merge conflicts of f2235b6 to master.Chris Craik2014-11-201-2/+3
|\ | | | | | | Change-Id: Ibcef3a37ca0749931d509b53bd52e53a7d30ddbb
| * Improve logging around performance critical eventsChris Craik2014-11-191-2/+3
| | | | | | | | | | | | | | | | | | | | bug:17702227 Add details useful to developers (such as layer size/View name), and switch away from logging implementation names/details, since they are generally not relevant to developers. Change-Id: Iee605d182f241450f7e75a6d0c283d51fa1312f5
* | Replace StatefulBaseRenderer inheritance with CanvasState memberTom Hudson2014-11-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Incrementally disentangles DisplayListRenderer and OpenGLRenderer. Introduces abstract CanvasStateClient class to share three functions between the two. Design doc at https://docs.google.com/a/google.com/document/d/1PY1JF7AfPEF2UOUAnETS5j_4_tnJShTAMExvpCJfP8o/edit?usp=sharing. BUG:15672762 R=djsollen@google.com,ccraik@google.com,jreck@google.com Change-Id: Ic9fdffe18808e7d921ad06d01ea1ca25b2ad6f23
* | Remove status return from all uirenderer::Renderer functionsTom Hudson2014-11-041-9/+8
|/ | | | | | | | | | | | | | This moves the interface closer to android::Canvas. The only use of return values was in the OpenGLRenderer subclass; that is replaced with an internal dirty flag: returned from finish(), checked by CanvasContext. This is part of a series of CLs to refactor the Graphics JNI bindings. BUG:15672762 R=djsollen@google.com,ccraik@google.com Change-Id: Ifd533eb8839a254b0d3a5d04fc5a2905afdfc89e
* Layer changesJohn Reck2014-10-311-11/+3
| | | | | | | | | | | | Bug: 17208461 * Switch Layer to be VirtualLightRefBase instead of Caches' side-channel ref-counting * Include active layers in gfxinfo dump * Run gfxinfo dump on the correct thread * Dump gfxinfo on Layer creation failure Change-Id: I28d195699e2334518e215ab28c7a17355aee9678
* Don't track TextureLayer lifecycles in RenderStateChris Craik2014-09-081-2/+1
| | | | | | | | | | bug:17208461 They are destroyed via finalizer-enqueued destroy method, so it's not valid to check that they've been destroyed at gl context destruction time. Change-Id: I670f69825547facd5f31d44acb406418881fee00
* Add layer/texture creation tracingJohn Reck2014-07-291-0/+3
| | | | Change-Id: I0af6a36c97a9f5f35d28e0e36539ba8d8011ea7c
* SkBitmap::Config is deprecated, use SkColorTypeMike Reed2014-07-081-5/+5
| | | | Change-Id: Ic953741325607bf85598c097bb3ab648d4a08996
* No-fail invokeFunctorJohn Reck2014-06-231-25/+30
| | | | | | | Bug: 15513308 Bug: 15449247 Change-Id: I13a29f9c8d4975cdda6dcb33b6332c2555ff0f7c
* am 678886fd: am b1fc06a4: am 5e7ef948: Merge "hwui: fix possible null ↵Chris Craik2014-06-171-1/+3
|\ | | | | | | | | | | | | pointer de-refrence" * commit '678886fde5cd779de79f8e38479aa6de82f8e755': hwui: fix possible null pointer de-refrence
| * hwui: fix possible null pointer de-refrenceDigish Pandya2014-06-131-1/+3
| | | | | | | | | | | | | | | | add layer check for null before de-refrencing it. issue link: http://code.google.com/p/android/issues/detail?id=61622 Change-Id: I54fc21ec594effcfb1eededd80dd5b0b52645c4c
* | Define light position (using new lighting spec) in JavaChris Craik2014-05-211-4/+0
| | | | | | | | | | | | Also updates the relative shadow strengths. Change-Id: I6cac7275d38df98aea9f0dda463cd7207102986a
* | Combine projection matrix, and viewport managementChris Craik2014-05-141-1/+1
| | | | | | | | | | | | | | Merge management of ortho projection matrix with the viewport size, since they should always be changed together. Change-Id: Iccb8f30828f4fb7848999ac54852e7ed2d6f2eb1
* | Fix TextureView texture filtering.Chris Craik2014-02-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | bug:11748993 TextureView should always be drawn with linear filtering if drawing a buffer sized differently from the layer. This fixes a bug where TextureViews that were sized differently from their contents wouldn't be drawn with texture filtering, causing visible scaling artifacts. Change-Id: I8a5d27452fe7269ec53896992f37cff51e3ce15a
* | Refactor HardwareLayerJohn Reck2014-02-101-4/+2
| | | | | | | | | | | | | | Defer all the things! Groundwork to allow hardware layers to work in a renderthread world Change-Id: Ib3aa47525f393083621254a743dbaa6352f933bd
* | Use const access to snapshot from OpenGLRendererChris Craik2014-01-021-1/+1
| | | | | | | | | | | | Additionally, move clipping methods to StatefulBaseRenderer Change-Id: Iff232bf16fc1ad3b7d89493da6d8915db7bc5e4f
* | Move Snapshot management to intermediate StatefulBaseRenderer classChris Craik2014-01-011-1/+1
|/ | | | | | | | | | | | | | | | | | The eventual goal is for the StatefulBaseRenderer to serve as the common base class between the DisplayListRenderer and OpenGLRenderer. This will separate DisplayList recording, Snapshot stack management, and the GL in OpenGLRenderer. Additionally, avoid sp<> parameters, and use const parameters in several places, with the intent of greatly reducing the surface area where renderer subclasses can modify snapshot stack. Next steps: -move bulk of clipping logic into StatefulBaseRenderer -disable direct snapshot access Change-Id: Ibc3c6747134ec7daf8ea535866239fa73b874390
* Use global indices array to draw layersRomain Guy2013-07-221-21/+0
| | | | | | | | | | | | An array of indices local to a layer would only be necessary if we changed the way we resolve T-junctions. Since we only ever draw quads, let's just use the indices we use everywhere else. This change also uses the global indices array to render list of colored rectangles to save on the number of vertices generated CPU-side. Change-Id: Ia6d1970b0e9247805af5a114ca2a84b5d0b7c282
* Avoid 9patch cache lookups when possibleRomain Guy2013-06-111-1/+1
| | | | | | | This optimization saves up to 0.3ms per frame on the Play Store's front page, on a Nexus 4 device. Change-Id: Iaa4ef33c6e3b37e175efd5b9eea9ef59b43f14f3
* Assume a texture is unbound after deleting itRomain Guy2013-06-061-1/+1
| | | | | | | | | | | Bug #9316260 The GL specification indicates that deleting a bound texture has the side effect of binding the default texture (name=0). This change replaces all calls to glDeleteTextures() by Caches::deleteTexture() to properly keep track of texture bindings. Change-Id: Ifbc60ef433e0f9776a668dd5bd5f0adbc65a77a0
* Introduce Caches::bindTexture() to reduce glBindTexture callsRomain Guy2013-06-041-1/+1
| | | | Change-Id: Ic345422567c020c0a9035ff51dcf2ae2a1fc59f4
* First OpenGL ES 3.0 based optimizationRomain Guy2013-04-041-1/+1
| | | | | | | | | | | | | | | This change uses a new OpenGL ES 3.0 feature to upload less data when the font cache needs to be update. This can result in significant performance improvements on device with large textures or with locales that use a lot of glyphs (CJK for instance.) This change also fixes various unpack alignment issues. The unpack alignment, as well as the unpack row length, is not texture specific but a global state that affect all glTex/SubImage2D calls. Some of them were missing the appropriate glPixelStorei() call. This could result in corrupted textures. Change-Id: Iefb429d4d0d0b4e0faeadf27daafee6d30a21d85
* Don't crash when making a layer larger than supported dimensionsRomain Guy2013-03-281-7/+18
| | | | | | | | | | | | | Bug #8437401 A misplaced ref count decrement was causing a crash when attempting to resize a layer to dimensions larger than the max texture size supported by the GPU. This change fixes the crash and clarifies the warnings to make it more obvious what's happening. Change-Id: I632dc1b90aaa2605969e10523491a81c4922d3dc
* Avoid multiple font cache texture uploadsRomain Guy2013-03-261-4/+4
| | | | | | | | | | Bug #8378964 This change defers drawing into layers until after the renderer for FBO0 is ready to draw. At that point, all the precaching is done which means all glyphs can be uploaded at once in the font caches. Change-Id: Ie1f7a7ff30f76f06fb3dbc72c7d05e66207d1ecb
* Take only the scale params into account to rasterize textRomain Guy2013-03-051-4/+4
| | | | | | | | | | This change extracts the scale parameters of the current transform to pass then to the font renderer. Rotation and perspective are applied to the generated mesh inside the vertex shader. This limits the number of glyphs we have to create in the font cache and thus reduces memory churn. Change-Id: Ic5b3bae2b2b0e0250a8ee723b071a1709725c749
* Fix T-junctions in layers' generated meshesChris Craik2013-02-271-8/+10
| | | | | | | | | | | | | | | bug:4128442 Currently we fix T-junctions for hardware layers, and for Canvas.saveLayer if the transform isn't rectAsRect. Ideally, hardware layers should lazily re-generate T-junction free geometry if the transform becomes non-rectAsRect Depends on frameworks/native change: https://googleplex-android-review.googlesource.com/#/c/277668/ which adds Region::createTJunctionFreeRegion() Change-Id: Ice75b4a1a4459ff835059ea81d70f7d1563fd96d
* Add a RenderBuffer object to store stencil buffers.Romain Guy2013-02-071-1/+1
| | | | | | | | | | | | | | | | | | Bug #7146141 This change is needed to add a render buffer cache to avoid creating and destroying stencil buffers on every frame. This change also allows the renderer to use a 1 bit or 4 bit stencil buffer whenever possible. Finally this change fixes a bug introduced by a previous CL which causes the stencil buffer to not be updated in certain conditions. The fix relies on a new optional parameter in drawColorRects() that can be used to avoid performing a quickReject on rectangles generated by the clip region. Change-Id: I2f55a8e807009887b276a83cde9f53fd5c01199f
* Fix graphical corruption on QCOM GPURomain Guy2013-01-291-0/+1
| | | | | | | | | Bug #7146141 The GL_QCOM_tiled_rendering extension requires careful use of start/endTiling when attaching a renderbuffer dynamically. Change-Id: I20036683ed3909ffaf40cc3d57a25257e35b6fa2
* Allow layers with a stencil buffer to be resized on the flyRomain Guy2013-01-181-1/+1
| | | | | | | | | Bug #7146141 This change moves the resizeLayer() from LayerCache (where it should never have been anyway) to Layer. This makes a little more sense. Change-Id: I8b2f9c19c558e738405a58b9e71ec5799fc6be88
* Implement clipRect with a transform, clipRegion & clipPathRomain Guy2013-01-171-1/+9
| | | | | | | | | | | | | | | | | | | | | Bug #7146141 When non-rectangular clipping occurs in a layer the render buffer used as the stencil buffer is not cached. If this happens on a View's hardware layer the render buffer will live for as long as the layer is bound to the view. When a stencil buffer is required because of a call to Canvas.saveLayer() it will be allocated on every frame. A future change will address this problem. If "show GPU overdraw" is enabled, non-rectangular clips are not supported anymore and we fall back to rectangular clips instead. This is a limitation imposed by OpenGL ES that cannot be worked around at this time. This change also improves the Matrix4 implementation to easily detect when a rect remains a rect after transform. Change-Id: I0e69fb901792d38bc0c4ca1bf9fdb02d7db415b9
* Defer layer rendering to avoid stallsRomain Guy2012-10-181-4/+19
| | | | | | | | | | | | | | | | | | | | 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
* Assign default texture id of 0Chet Haase2012-09-261-7/+1
| | | | | | | | | | 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
* Revert "Deleting objects on the wrong thread is a silly idea Bug #7195815"Dave Burke2012-09-251-0/+8
| | | | | | This reverts commit 8a1374946a928fcba7495c87ff6adda327fdfb9f Change-Id: I53564a6c531d334afcc1fce0bea1e57ae266aa78
* Deleting objects on the wrong thread is a silly ideaRomain Guy2012-09-251-8/+0
| | | | | | | | Bug #7195815 Turns out that multi-threading is hard. Change-Id: Ib0b4bd6dc3caea27f7ced22cbb363bb955fe58ab
* Merge "Polygonal rendering of simple fill shapes" into jb-mr1-devChris Craik2012-09-211-2/+7
|\
| * Polygonal rendering of simple fill shapesChris Craik2012-09-201-2/+7
| | | | | | | | | | | | bug:4419017 Change-Id: If0428e1732139786cba15f54b285d880e4a56b89
* | Update layers in a single batch at the beginning of a frameRomain Guy2012-09-211-0/+4
|/ | | | | | Bug #7186819 Change-Id: Ice5926dfedfb3be3a3064e65008dafa2852407da
* Minimize state changes when updating layersRomain Guy2012-09-181-0/+4
| | | | Change-Id: I407fcc80bd3178f9f09a3b379ceb7f7ce0749e08
* Fix occasional crash bug with layersChet Haase2012-09-171-7/+3
| | | | | | | | | | | | | | | | | | | | Launcher occasionally crashes with a stack trace indicating that the memory of a Layer object is corrupt. It is possible for us to delete a Layer structure and then, briefly, use it to draw a DisplayList again before that DisplayList gets recreated (without the layer that got deleted). When this happens, if the memory got corrupted, it's possible to crash. The fix is to add Layer to the other objects which we currently refcount (bitmaps, shaders, etc.). Then instead of deleting a Layer, we decrement the refcount. We increment when creating it, then increment it again when it's referenced from a DisplayList. Then we decrement the refcount instead of deleting it, and decrement when we clear a DisplayList that refers to it. Then when the refcount reaches 0, we delete it. Issue #6994632 Native crash in launcher when trying to launch all apps screen Change-Id: I0627be8d49bb2f9ba8d158a84b764bb4e7df934c
* Discard framebuffer commands when we redraw the entire bufferRomain Guy2012-09-111-3/+3
| | | | Change-Id: I32e3014832cbd3bdbace8c3d2206eb20a2002d64
* Fix memory corruption in LayerRenderer::copyLayerRomain Guy2012-09-071-0/+2
| | | | | | | | The pixel store pack alignment was not set for the source texture, causing a write to occur outside of the destination bitmap's bounds. Change-Id: Iaa5767acf7b5943fbc2765c3810a142f06b1a796