summaryrefslogtreecommitdiffstats
path: root/libs/hwui/LayerRenderer.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix TextureView texture filtering.Chris Craik2014-02-251-1/+1
| | | | | | | | | | | | | 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-2/+2
| | | | | | | Defer all the things! Groundwork to allow hardware layers to work in a renderthread world Change-Id: Ib3aa47525f393083621254a743dbaa6352f933bd
* 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
* 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
* Implement clipRect with a transform, clipRegion & clipPathRomain Guy2013-01-171-0/+1
| | | | | | | | | | | | | | | | | | | | | 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-1/+2
| | | | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | | | 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-2/+2
| | | | | | This reverts commit 8a1374946a928fcba7495c87ff6adda327fdfb9f Change-Id: I53564a6c531d334afcc1fce0bea1e57ae266aa78
* Deleting objects on the wrong thread is a silly ideaRomain Guy2012-09-251-2/+2
| | | | | | | | Bug #7195815 Turns out that multi-threading is hard. Change-Id: Ib0b4bd6dc3caea27f7ced22cbb363bb955fe58ab
* Update layers in a single batch at the beginning of a frameRomain Guy2012-09-211-4/+6
| | | | | | Bug #7186819 Change-Id: Ice5926dfedfb3be3a3064e65008dafa2852407da
* Minimize state changes when updating layersRomain Guy2012-09-181-0/+1
| | | | Change-Id: I407fcc80bd3178f9f09a3b379ceb7f7ce0749e08
* Remove unused View.flushLayer() APIRomain Guy2012-07-111-1/+2
| | | | Change-Id: I5d4c7388afb5265964ab6b769cc0abfee9745c84
* Track canvas clearing for swap buffers logic.Chet Haase2012-06-071-1/+1
| | | | | | | | | | | | | | | | A previous fix made it necessary for a frame to render something to GL in order to cause a call to eglSwapBuffers(). Besides the calls being tracked as part of issuing a DisplayList, there is also a potential call to clear the canvas (via glClear()) on non-opaque surfaces. This call is also good to track, since a surface that gets cleared without any other drawing operations is worth flipping to the screen (to erase old contents on that surface). This fix tracks the status of the pre-draw operations to find out whether glClear() was called and then sets the drawing status appropriately. Issue #6606422 QuickContact dismissal is janky again (Tracking) Change-Id: I5fcaccfdc9293dd46b83f2fc279730a5d2740ebf
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-031-1/+1
| | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
* Discard framebuffer rendering queues when discarding layersRomain Guy2011-12-061-0/+1
| | | | | | Bug #5581817 Change-Id: Ie30700a29059d2ea60eb7bd3f8bd20ac48a149ab
* Revert "Discard framebuffer rendering queues when discarding layers"Dave Burke2011-11-141-1/+0
| | | | This reverts commit da96f8ac2c1c35a54f3f36e6d776cb386a251d03.
* Discard framebuffer rendering queues when discarding layersRomain Guy2011-11-101-0/+1
| | | | | | Bug #5581817 Change-Id: If612846ec5f7793710fc4df152791fb32c506551
* Reduce the size of libhwui by 50%Romain Guy2011-10-121-17/+16
| | | | | | | | 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
* Add the ability to specify the opacity of a TextureViewRomain Guy2011-06-221-2/+2
| | | | | | TextureView assumes its content is opaque by default. Change-Id: Iba873423566a5b67c388081838bd910dceba32ba
* Add TextureView.getBitmap()Romain Guy2011-06-141-0/+3
| | | | | | | This API can be used to get a Bitmap copy of the content of a TextureView. Change-Id: I07522216c353720fba5cab333174f58f484eb911
* Allows to render with an OpenGL context inside a TextureView.Romain Guy2011-05-021-1/+1
| | | | Change-Id: I59453f7fc3997f0502a1c5d325d37fed376fabc7
* New widget: TextureViewRomain Guy2011-04-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Enable partial invalidates when rendering with OpenGL.Romain Guy2011-01-241-1/+1
| | | | Change-Id: Ie8be06c4776b815e8737753eb8003b4fd8936130
* Make embedded hardware layers work.Romain Guy2011-01-191-2/+1
| | | | | | Bug #3369474 Change-Id: Ib6d7fb44eedda9dc2933b5e1b176f307968af91d
* Don't blend transparent pixels when rendering layers.Romain Guy2011-01-161-0/+5
| | | | | | | | With this change, the rendere keeps track of what regions are rendered into and generates a mesh that matches these regions exactly. The mesh is used to composite the layer on screen. Change-Id: I1f342576b9134fb29caff7fb8f4c1da179fe956d
* Cleanup implementation of hardware layers.Romain Guy2011-01-131-8/+7
| | | | | | | | | | The new implementation relies on OpenGLRenderer's existing layer code instead of duplicating it. The new code is much cleaner, with simpler and better APIs and allows tracking of drawn regions inside layers. Region tracking is not yet enabled but this will be done in a future CL. Change-Id: Ie826121a2227de8252c77b992a61218defea5143
* Add logging to the new layers API.Romain Guy2011-01-121-0/+11
| | | | Change-Id: I78b9426eb17de3e775aca9fafe4a50bd9c0785c4
* Cleanup GL objects on the correct thread.Romain Guy2011-01-121-0/+1
| | | | Change-Id: Iddfea6e08a6591a4fab147151098ef27005f373d
* Better backend for hardware layers.Romain Guy2011-01-111-0/+55
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