summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Layer.h
Commit message (Collapse)AuthorAgeFilesLines
* Refcount RenderNodeJohn Reck2014-04-071-8/+3
| | | | Change-Id: I7a86db8acc2b78ef33d987a43a119f5933d7d752
* Async drawing!John Reck2014-03-271-2/+4
| | | | Change-Id: I7e728356f58af88174328a8c0b90d27b128bfe01
* Rename DisplayList->RenderNodeJohn Reck2014-03-121-3/+3
| | | | Change-Id: Id42e23c9a1a6eb6eaeafef707ced7fa6887b03d0
* Fix TextureView texture filtering.Chris Craik2014-02-251-0/+14
| | | | | | | | | | | | | 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
* Reapply "Refactor setting an SkPaint onto a hwui Layer."Derek Sollenberger2014-02-201-1/+1
| | | | | | This reverts commit 90d0c75e94a32fb7d993fae69762820aabc2fcbb. Change-Id: Ie807761231edf7c848b019931dccbf466208c0be
* Revert "Refactor setting an SkPaint onto a hwui Layer."Derek Sollenberger2014-02-121-1/+1
| | | | | | This reverts commit e889298cd6ae1fc0d76bc00d7d12586db03eb261. Change-Id: I4b1d609b2d4280595d40cb10d6c18875c22999f8
* Refactor setting an SkPaint onto a hwui Layer.Derek Sollenberger2014-02-121-1/+1
| | | | | | | This CL removes the unecessary JNI call to set the colorFilter on a layer. Change-Id: I9e088f888938d4315745aa618334bfdb9e61343a
* Removing SkiaColorFilter and inspecting the native object directly.Derek Sollenberger2014-02-071-4/+5
| | | | | bug: 10650594 Change-Id: I4fcf66d008765afa0e35d011f58bc792183cb74f
* Fix Clang warnings/errorsChris Craik2014-01-021-1/+2
| | | | | | | Fix several build warnings (struct != class, int != size_t) and errors (variable leng non-POD arrays). Change-Id: I70b4e784365514303d8954bfcb1f39d7c22c1321
* Use global indices array to draw layersRomain Guy2013-07-221-1/+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
* Cancel layer update when a layer is about to be destroyedRomain Guy2013-06-171-0/+1
| | | | | | Bug #9310706 Change-Id: I73eea6314c326f15a979617e3a05b525935f0d3f
* Introduce Caches::bindTexture() to reduce glBindTexture callsRomain Guy2013-06-041-37/+9
| | | | Change-Id: Ic345422567c020c0a9035ff51dcf2ae2a1fc59f4
* Make layer double drawing visible in overdraw debug modeChris Craik2013-04-161-0/+1
| | | | | | | | | | | | | | | | | | A clipped saveLayer will cause two draws - first to an onscreen buffer, then again back to the framebuffer. This change - when in overdraw debug - reissues draws associated with a clipped saveLayer, but only to the stencil buffer. Operations within a saveLayer are shown correctly to be twice drawn, and View.setAlpha() without an associated hardware layer, or hasOverlappingRendering() are made more visible. Hardware layers, on any frame that they are updated, similarly draw twice, and will also be counted against the stencil buffer doubly. Note: greater depths of layers - e.g. a saveLayer within a saveLayer - are not respected, as that would require additional region tracking. Change-Id: I61fb0e61038fe66013d59914c20bb47a550dea7d
* First OpenGL ES 3.0 based optimizationRomain Guy2013-04-041-3/+4
| | | | | | | | | | | | | | | 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
* Prevent crash when a single layer is enqueued several times for updatesRomain Guy2013-03-291-0/+1
| | | | | | Bug #8504687 Change-Id: I9b01bbc4e3f37af23dfe5e68d3d03ad3d238b94a
* Avoid multiple font cache texture uploadsRomain Guy2013-03-261-0/+11
| | | | | | | | | | 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
* Merge "Add a RenderBuffer object to store stencil buffers. Bug #7146141"Romain Guy2013-02-071-28/+28
|\
| * Add a RenderBuffer object to store stencil buffers.Romain Guy2013-02-071-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am f5f85022: Merge "Fix graphical corruption on QCOM GPU Bug #7146141"Romain Guy2013-01-291-0/+4
|\ \ | |/ | | | | | | | | # Via Android (Google) Code Review (1) and Romain Guy (1) * commit 'f5f8502271b04d63c518e3aecfd5eaf557904e72': Fix graphical corruption on QCOM GPU Bug #7146141
| * Fix graphical corruption on QCOM GPURomain Guy2013-01-291-0/+4
| | | | | | | | | | | | | | | | | | Bug #7146141 The GL_QCOM_tiled_rendering extension requires careful use of start/endTiling when attaching a renderbuffer dynamically. Change-Id: I20036683ed3909ffaf40cc3d57a25257e35b6fa2
* | am 49464796: Merge "Allow layers with a stencil buffer to be resized on the ↵Romain Guy2013-01-181-1/+30
|\ \ | |/ | | | | | | | | | | fly Bug #7146141" * commit '494647961feb21d925d5e6e5ce1d42aa8b6949db': Allow layers with a stencil buffer to be resized on the fly Bug #7146141
| * Allow layers with a stencil buffer to be resized on the flyRomain Guy2013-01-181-1/+30
| | | | | | | | | | | | | | | | | | 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
* | am b12db26f: Merge "Implement clipRect with a transform, clipRegion & ↵Romain Guy2013-01-171-5/+20
|\ \ | |/ | | | | | | | | | | clipPath Bug #7146141" * commit 'b12db26fec178794915d819c3dd64f13d788c461': Implement clipRect with a transform, clipRegion & clipPath Bug #7146141
| * Implement clipRect with a transform, clipRegion & clipPathRomain Guy2013-01-171-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Update framework to support r5967 of Skia.Derek Sollenberger2012-12-121-0/+1
|/ | | | | bug: 6906025 Change-Id: Iefdb830ec3aa2ab3472c1c142484a7aa21788a15
* Apply dev. settings at runtimeRomain Guy2012-11-301-0/+1
| | | | | | Bug #7434649 Change-Id: I16f00eaa8a5eefd9f9849e196cf2cb1659215390
* Defer layer rendering to avoid stallsRomain Guy2012-10-181-0/+14
| | | | | | | | | | | | | | | | | | | | 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
* Take into account the texture layer's transform for clippingRomain Guy2012-10-171-0/+3
| | | | | | Bug #7370212 Change-Id: Ibdc3161306f54a1cfe66e08458f05ee01a13b1df
* Assign default texture id of 0Chet Haase2012-09-261-1/+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/+2
| | | | | | This reverts commit 8a1374946a928fcba7495c87ff6adda327fdfb9f Change-Id: I53564a6c531d334afcc1fce0bea1e57ae266aa78
* Deleting objects on the wrong thread is a silly ideaRomain Guy2012-09-251-2/+0
| | | | | | | | Bug #7195815 Turns out that multi-threading is hard. Change-Id: Ib0b4bd6dc3caea27f7ced22cbb363bb955fe58ab
* Don't destroy the same texture twiceRomain Guy2012-09-251-7/+19
| | | | | | | | | | | | | 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
* Avoid deadlock when deleting layersRomain Guy2012-09-231-1/+2
| | | | | | Bug #7217459 Change-Id: I12bfa6c30c5030bd1b23ea6a3ce64240ab1dfba3
* Fix occasional crash bug with layersChet Haase2012-09-171-15/+1
| | | | | | | | | | | | | | | | | | | | 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
* Enable changing properties of layer paintChet Haase2012-09-071-7/+5
| | | | | | | | | | | | Previously, to draw a layered view with a changed Paint object for the drawLayer operation, you'd have to invalidate the parent view, to get the native DisplayList to pick up the new Paint properties. This change adds API and functionality so that the developer can call setLayerPaint(), which does the proper invalidation (lightweight, doesn't cause redrawing the view). Issue #6923810 Make it easy to efficiently animate a layer's Paint Change-Id: I7fea79788d50f6d9c86dd5e5b2a4490cb95142bb
* Deferred layer updatesRomain Guy2012-03-021-0/+24
| | | | Change-Id: I83d9e564fe274db658dcee9e0cc5bbf9223ebb49
* Optimize away unnecessary state changesRomain Guy2011-11-301-4/+4
| | | | Change-Id: I0f6816f9f6234853575ecee5033186ad19e76380
* Add an API to set the transform on a TextureView's surface texture.Romain Guy2011-08-161-0/+9
| | | | | | Bug #5156689 Change-Id: I635a625885c9b832a60d44ece0de7613ceb84109
* Make sure we have a current EGL context when invoking EGLRomain Guy2011-07-261-0/+4
| | | | | | Bug #5081795 Change-Id: Iee3382d362a71c1e6c5c498b319bf7f7bcf5a2f0
* Improve rendering performance on some GPUsRomain Guy2011-07-251-22/+2
| | | | | | | | 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
* Use NEAREST filtering for layers whenever possible.Romain Guy2011-07-071-47/+184
| | | | Change-Id: Id5bee1bd4a322cf93e8000b08e18f1e1b058648e
* Allows to render with an OpenGL context inside a TextureView.Romain Guy2011-05-021-0/+6
| | | | Change-Id: I59453f7fc3997f0502a1c5d325d37fed376fabc7
* New widget: TextureViewRomain Guy2011-04-281-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Correctly compute tex coords for rect layers.Romain Guy2011-04-271-0/+17
| | | | | | | | Bug #4192695 This change also fixes Javadoc links in the framework. Change-Id: Ia548bcb18baba5d6fe6a4a04a2278e3a3bd465b2
* Optimize rect-shaped layers.Romain Guy2011-03-181-0/+5
| | | | | | | This brings back an optimization disabled in HC-MR1. This time the correct geometry is generated to avoid unnecessary blending. Change-Id: Id56404dc46bb84c75facc25c18488a690741b592
* Don't blend transparent pixels when rendering layers.Romain Guy2011-01-161-0/+16
| | | | | | | | 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
* New layers API for Views.Romain Guy2011-01-061-0/+6
| | | | | | | | | This API can be used to back a view and its children with either a software layer (bitmap) or hardware layer (FBO). Layers have various usages, including color filtering and performance improvements during animations. Change-Id: Ifc3bea847918042730fc5a8c2d4206dd6c9420a3
* Optimize FBO drawing with regions.Romain Guy2010-11-021-3/+11
| | | | | | | | | 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
* Better cache for layers, reduce memory usage and increase framerate.Romain Guy2010-10-081-25/+26
| | | | Change-Id: I5ff864a361db4791bd5ff6be716f7ce692ef572d
* Optimize saveLayer() when the clip flag is set.Romain Guy2010-10-051-12/+10
| | | This speeds up applications, especially Launcher.