Chet Haase | d15ebf2 | 2012-09-05 11:40:29 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Chris Craik | 65fe5ee | 2015-01-26 18:06:29 -0800 | [diff] [blame] | 17 | #include "Layer.h" |
Chet Haase | d15ebf2 | 2012-09-05 11:40:29 -0700 | [diff] [blame] | 18 | |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 19 | #include "Caches.h" |
Romain Guy | 96885eb | 2013-03-26 15:05:58 -0700 | [diff] [blame] | 20 | #include "DeferredDisplayList.h" |
Chet Haase | 98d3a64 | 2012-09-26 10:27:40 -0700 | [diff] [blame] | 21 | #include "LayerRenderer.h" |
Chet Haase | d15ebf2 | 2012-09-05 11:40:29 -0700 | [diff] [blame] | 22 | #include "OpenGLRenderer.h" |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 23 | #include "RenderNode.h" |
Chris Craik | 65fe5ee | 2015-01-26 18:06:29 -0800 | [diff] [blame] | 24 | #include "renderstate/RenderState.h" |
Chris Craik | 70850ea | 2014-11-18 10:49:23 -0800 | [diff] [blame] | 25 | #include "utils/TraceUtils.h" |
| 26 | |
Chris Craik | 65fe5ee | 2015-01-26 18:06:29 -0800 | [diff] [blame] | 27 | #include <utils/Log.h> |
| 28 | |
Chris Craik | 70850ea | 2014-11-18 10:49:23 -0800 | [diff] [blame] | 29 | #define ATRACE_LAYER_WORK(label) \ |
| 30 | ATRACE_FORMAT("%s HW Layer DisplayList %s %ux%u", \ |
| 31 | label, \ |
| 32 | (renderNode.get() != NULL) ? renderNode->getName() : "", \ |
| 33 | getWidth(), getHeight()) |
Chet Haase | d15ebf2 | 2012-09-05 11:40:29 -0700 | [diff] [blame] | 34 | |
| 35 | namespace android { |
| 36 | namespace uirenderer { |
| 37 | |
Chris Craik | e5c6584 | 2015-03-02 17:50:26 -0800 | [diff] [blame] | 38 | Layer::Layer(Type layerType, RenderState& renderState, uint32_t layerWidth, uint32_t layerHeight) |
John Reck | 38e0c32 | 2015-11-10 12:19:17 -0800 | [diff] [blame] | 39 | : GpuMemoryTracker(GpuObjectType::Layer) |
| 40 | , state(State::Uncached) |
Chris Craik | bfd1cd6 | 2014-09-10 13:04:31 -0700 | [diff] [blame] | 41 | , caches(Caches::getInstance()) |
John Reck | 3b20251 | 2014-06-23 13:13:08 -0700 | [diff] [blame] | 42 | , renderState(renderState) |
Chris Craik | 8a226d2 | 2014-09-08 16:40:21 -0700 | [diff] [blame] | 43 | , texture(caches) |
| 44 | , type(layerType) { |
John Reck | 0e89e2b | 2014-10-31 14:49:06 -0700 | [diff] [blame] | 45 | // TODO: This is a violation of Android's typical ref counting, but it |
| 46 | // preserves the old inc/dec ref locations. This should be changed... |
Chris Craik | d41c4d8 | 2015-01-05 15:51:13 -0800 | [diff] [blame] | 47 | incStrong(nullptr); |
Chet Haase | 603f6de | 2012-09-14 15:31:25 -0700 | [diff] [blame] | 48 | renderTarget = GL_TEXTURE_2D; |
John Reck | 38e0c32 | 2015-11-10 12:19:17 -0800 | [diff] [blame] | 49 | texture.mWidth = layerWidth; |
| 50 | texture.mHeight = layerHeight; |
John Reck | 0e89e2b | 2014-10-31 14:49:06 -0700 | [diff] [blame] | 51 | renderState.registerLayer(this); |
Chet Haase | 603f6de | 2012-09-14 15:31:25 -0700 | [diff] [blame] | 52 | } |
| 53 | |
Chet Haase | d15ebf2 | 2012-09-05 11:40:29 -0700 | [diff] [blame] | 54 | Layer::~Layer() { |
John Reck | 0e89e2b | 2014-10-31 14:49:06 -0700 | [diff] [blame] | 55 | renderState.unregisterLayer(this); |
Derek Sollenberger | 76d3a1b | 2013-12-10 12:28:58 -0500 | [diff] [blame] | 56 | SkSafeUnref(colorFilter); |
John Reck | 5799801 | 2015-01-29 10:17:57 -0800 | [diff] [blame] | 57 | |
John Reck | 38e0c32 | 2015-11-10 12:19:17 -0800 | [diff] [blame] | 58 | if (stencil || fbo || texture.mId) { |
John Reck | 5799801 | 2015-01-29 10:17:57 -0800 | [diff] [blame] | 59 | removeFbo(); |
John Reck | 38e0c32 | 2015-11-10 12:19:17 -0800 | [diff] [blame] | 60 | texture.deleteTexture(); |
John Reck | 5799801 | 2015-01-29 10:17:57 -0800 | [diff] [blame] | 61 | } |
Romain Guy | 96885eb | 2013-03-26 15:05:58 -0700 | [diff] [blame] | 62 | |
| 63 | delete[] mesh; |
Romain Guy | 97dc917 | 2012-09-23 17:46:45 -0700 | [diff] [blame] | 64 | } |
| 65 | |
John Reck | 5799801 | 2015-01-29 10:17:57 -0800 | [diff] [blame] | 66 | void Layer::onGlContextLost() { |
| 67 | removeFbo(); |
John Reck | 38e0c32 | 2015-11-10 12:19:17 -0800 | [diff] [blame] | 68 | texture.deleteTexture(); |
John Reck | 5799801 | 2015-01-29 10:17:57 -0800 | [diff] [blame] | 69 | } |
| 70 | |
Romain Guy | 2055aba | 2013-01-18 16:42:51 -0800 | [diff] [blame] | 71 | uint32_t Layer::computeIdealWidth(uint32_t layerWidth) { |
| 72 | return uint32_t(ceilf(layerWidth / float(LAYER_SIZE)) * LAYER_SIZE); |
| 73 | } |
| 74 | |
| 75 | uint32_t Layer::computeIdealHeight(uint32_t layerHeight) { |
| 76 | return uint32_t(ceilf(layerHeight / float(LAYER_SIZE)) * LAYER_SIZE); |
| 77 | } |
| 78 | |
John Reck | 668f0e3 | 2014-03-26 15:10:40 -0700 | [diff] [blame] | 79 | void Layer::requireRenderer() { |
| 80 | if (!renderer) { |
Chris Craik | 51d6a3d | 2014-12-22 17:16:56 -0800 | [diff] [blame] | 81 | renderer.reset(new LayerRenderer(renderState, this)); |
John Reck | 668f0e3 | 2014-03-26 15:10:40 -0700 | [diff] [blame] | 82 | renderer->initProperties(); |
| 83 | } |
| 84 | } |
| 85 | |
Chris Craik | 69e5adf | 2014-08-14 13:34:01 -0700 | [diff] [blame] | 86 | void Layer::updateLightPosFromRenderer(const OpenGLRenderer& rootRenderer) { |
| 87 | if (renderer && rendererLightPosDirty) { |
| 88 | // re-init renderer's light position, based upon last cached location in window |
| 89 | Vector3 lightPos = rootRenderer.getLightCenter(); |
| 90 | cachedInvTransformInWindow.mapPoint3d(lightPos); |
Alan Viverette | 50210d9 | 2015-05-14 18:05:36 -0700 | [diff] [blame] | 91 | renderer->initLight(rootRenderer.getLightRadius(), |
| 92 | rootRenderer.getAmbientShadowAlpha(), |
| 93 | rootRenderer.getSpotShadowAlpha()); |
| 94 | renderer->setLightCenter(lightPos); |
Chris Craik | 69e5adf | 2014-08-14 13:34:01 -0700 | [diff] [blame] | 95 | rendererLightPosDirty = false; |
| 96 | } |
| 97 | } |
| 98 | |
Romain Guy | 2055aba | 2013-01-18 16:42:51 -0800 | [diff] [blame] | 99 | bool Layer::resize(const uint32_t width, const uint32_t height) { |
| 100 | uint32_t desiredWidth = computeIdealWidth(width); |
| 101 | uint32_t desiredHeight = computeIdealWidth(height); |
| 102 | |
| 103 | if (desiredWidth <= getWidth() && desiredHeight <= getHeight()) { |
| 104 | return true; |
| 105 | } |
| 106 | |
John Reck | ec4cefc | 2014-07-29 09:49:13 -0700 | [diff] [blame] | 107 | ATRACE_NAME("resizeLayer"); |
| 108 | |
Romain Guy | 8aa195d | 2013-06-04 18:00:09 -0700 | [diff] [blame] | 109 | const uint32_t maxTextureSize = caches.maxTextureSize; |
Romain Guy | ce4a7df | 2013-03-28 11:32:33 -0700 | [diff] [blame] | 110 | if (desiredWidth > maxTextureSize || desiredHeight > maxTextureSize) { |
| 111 | ALOGW("Layer exceeds max. dimensions supported by the GPU (%dx%d, max=%dx%d)", |
| 112 | desiredWidth, desiredHeight, maxTextureSize, maxTextureSize); |
| 113 | return false; |
| 114 | } |
| 115 | |
Romain Guy | 2055aba | 2013-01-18 16:42:51 -0800 | [diff] [blame] | 116 | uint32_t oldWidth = getWidth(); |
| 117 | uint32_t oldHeight = getHeight(); |
| 118 | |
| 119 | setSize(desiredWidth, desiredHeight); |
| 120 | |
| 121 | if (fbo) { |
Chris Craik | 44eb2c0 | 2015-01-29 09:45:09 -0800 | [diff] [blame] | 122 | caches.textureState().activateTexture(0); |
Romain Guy | 2055aba | 2013-01-18 16:42:51 -0800 | [diff] [blame] | 123 | bindTexture(); |
Romain Guy | 0908764 | 2013-04-04 12:27:54 -0700 | [diff] [blame] | 124 | allocateTexture(); |
Romain Guy | 2055aba | 2013-01-18 16:42:51 -0800 | [diff] [blame] | 125 | |
| 126 | if (glGetError() != GL_NO_ERROR) { |
| 127 | setSize(oldWidth, oldHeight); |
| 128 | return false; |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | if (stencil) { |
Romain Guy | 3bbacf2 | 2013-02-06 16:51:04 -0800 | [diff] [blame] | 133 | stencil->bind(); |
| 134 | stencil->resize(desiredWidth, desiredHeight); |
Romain Guy | 2055aba | 2013-01-18 16:42:51 -0800 | [diff] [blame] | 135 | |
| 136 | if (glGetError() != GL_NO_ERROR) { |
| 137 | setSize(oldWidth, oldHeight); |
| 138 | return false; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | return true; |
| 143 | } |
| 144 | |
Romain Guy | 8ce0030 | 2013-01-15 18:51:42 -0800 | [diff] [blame] | 145 | void Layer::removeFbo(bool flush) { |
| 146 | if (stencil) { |
John Reck | 3b20251 | 2014-06-23 13:13:08 -0700 | [diff] [blame] | 147 | GLuint previousFbo = renderState.getFramebuffer(); |
| 148 | renderState.bindFramebuffer(fbo); |
Romain Guy | 8ce0030 | 2013-01-15 18:51:42 -0800 | [diff] [blame] | 149 | glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0); |
John Reck | 3b20251 | 2014-06-23 13:13:08 -0700 | [diff] [blame] | 150 | renderState.bindFramebuffer(previousFbo); |
Romain Guy | 8ce0030 | 2013-01-15 18:51:42 -0800 | [diff] [blame] | 151 | |
Romain Guy | 8aa195d | 2013-06-04 18:00:09 -0700 | [diff] [blame] | 152 | caches.renderBufferCache.put(stencil); |
Chris Craik | d41c4d8 | 2015-01-05 15:51:13 -0800 | [diff] [blame] | 153 | stencil = nullptr; |
Romain Guy | 8ce0030 | 2013-01-15 18:51:42 -0800 | [diff] [blame] | 154 | } |
| 155 | |
Chet Haase | 98d3a64 | 2012-09-26 10:27:40 -0700 | [diff] [blame] | 156 | if (fbo) { |
John Reck | 3b20251 | 2014-06-23 13:13:08 -0700 | [diff] [blame] | 157 | if (flush) LayerRenderer::flushLayer(renderState, this); |
Chris Craik | 818c9fb | 2015-10-23 14:33:42 -0700 | [diff] [blame] | 158 | renderState.deleteFramebuffer(fbo); |
Chet Haase | 98d3a64 | 2012-09-26 10:27:40 -0700 | [diff] [blame] | 159 | fbo = 0; |
Dave Burke | 56257af | 2012-09-25 20:30:09 -0700 | [diff] [blame] | 160 | } |
| 161 | } |
| 162 | |
Chris Craik | a7090e0 | 2014-06-20 16:01:00 -0700 | [diff] [blame] | 163 | void Layer::updateDeferred(RenderNode* renderNode, int left, int top, int right, int bottom) { |
John Reck | 087bc0c | 2014-04-04 16:20:08 -0700 | [diff] [blame] | 164 | requireRenderer(); |
Chris Craik | a7090e0 | 2014-06-20 16:01:00 -0700 | [diff] [blame] | 165 | this->renderNode = renderNode; |
John Reck | 087bc0c | 2014-04-04 16:20:08 -0700 | [diff] [blame] | 166 | const Rect r(left, top, right, bottom); |
| 167 | dirtyRect.unionWith(r); |
| 168 | deferredUpdateScheduled = true; |
| 169 | } |
| 170 | |
Derek Sollenberger | 674554f | 2014-02-19 16:47:32 +0000 | [diff] [blame] | 171 | void Layer::setPaint(const SkPaint* paint) { |
Chris Craik | bf6f0f2 | 2015-10-01 12:36:07 -0700 | [diff] [blame] | 172 | alpha = PaintUtils::getAlphaDirect(paint); |
| 173 | mode = PaintUtils::getXfermodeDirect(paint); |
Chris Craik | d41c4d8 | 2015-01-05 15:51:13 -0800 | [diff] [blame] | 174 | setColorFilter((paint) ? paint->getColorFilter() : nullptr); |
Chet Haase | d15ebf2 | 2012-09-05 11:40:29 -0700 | [diff] [blame] | 175 | } |
| 176 | |
Derek Sollenberger | 76d3a1b | 2013-12-10 12:28:58 -0500 | [diff] [blame] | 177 | void Layer::setColorFilter(SkColorFilter* filter) { |
| 178 | SkRefCnt_SafeAssign(colorFilter, filter); |
Romain Guy | 8aa195d | 2013-06-04 18:00:09 -0700 | [diff] [blame] | 179 | } |
| 180 | |
| 181 | void Layer::bindTexture() const { |
John Reck | 38e0c32 | 2015-11-10 12:19:17 -0800 | [diff] [blame] | 182 | if (texture.mId) { |
| 183 | caches.textureState().bindTexture(renderTarget, texture.mId); |
Romain Guy | 8aa195d | 2013-06-04 18:00:09 -0700 | [diff] [blame] | 184 | } |
| 185 | } |
| 186 | |
| 187 | void Layer::bindStencilRenderBuffer() const { |
| 188 | if (stencil) { |
| 189 | stencil->bind(); |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | void Layer::generateTexture() { |
John Reck | 38e0c32 | 2015-11-10 12:19:17 -0800 | [diff] [blame] | 194 | if (!texture.mId) { |
| 195 | glGenTextures(1, &texture.mId); |
Romain Guy | 8aa195d | 2013-06-04 18:00:09 -0700 | [diff] [blame] | 196 | } |
| 197 | } |
| 198 | |
| 199 | void Layer::clearTexture() { |
John Reck | db00917 | 2016-03-17 11:02:07 -0700 | [diff] [blame] | 200 | // There's a rare possibility that Caches could have been destroyed already |
| 201 | // since this method is queued up as a task. |
| 202 | // Since this is a reset method, treat this as non-fatal. |
| 203 | if (caches.isInitialized()) { |
| 204 | caches.textureState().unbindTexture(texture.mId); |
| 205 | } |
John Reck | 38e0c32 | 2015-11-10 12:19:17 -0800 | [diff] [blame] | 206 | texture.mId = 0; |
Romain Guy | 8aa195d | 2013-06-04 18:00:09 -0700 | [diff] [blame] | 207 | } |
| 208 | |
| 209 | void Layer::allocateTexture() { |
| 210 | #if DEBUG_LAYERS |
| 211 | ALOGD(" Allocate layer: %dx%d", getWidth(), getHeight()); |
| 212 | #endif |
John Reck | 38e0c32 | 2015-11-10 12:19:17 -0800 | [diff] [blame] | 213 | if (texture.mId) { |
| 214 | texture.updateSize(getWidth(), getHeight(), GL_RGBA); |
Romain Guy | 8aa195d | 2013-06-04 18:00:09 -0700 | [diff] [blame] | 215 | glTexImage2D(renderTarget, 0, GL_RGBA, getWidth(), getHeight(), 0, |
Chris Craik | d41c4d8 | 2015-01-05 15:51:13 -0800 | [diff] [blame] | 216 | GL_RGBA, GL_UNSIGNED_BYTE, nullptr); |
Chet Haase | d15ebf2 | 2012-09-05 11:40:29 -0700 | [diff] [blame] | 217 | } |
| 218 | } |
| 219 | |
Chris Craik | 69e5adf | 2014-08-14 13:34:01 -0700 | [diff] [blame] | 220 | void Layer::defer(const OpenGLRenderer& rootRenderer) { |
Chris Craik | 70850ea | 2014-11-18 10:49:23 -0800 | [diff] [blame] | 221 | ATRACE_LAYER_WORK("Optimize"); |
| 222 | |
Chris Craik | 69e5adf | 2014-08-14 13:34:01 -0700 | [diff] [blame] | 223 | updateLightPosFromRenderer(rootRenderer); |
Romain Guy | 96885eb | 2013-03-26 15:05:58 -0700 | [diff] [blame] | 224 | const float width = layer.getWidth(); |
| 225 | const float height = layer.getHeight(); |
| 226 | |
| 227 | if (dirtyRect.isEmpty() || (dirtyRect.left <= 0 && dirtyRect.top <= 0 && |
| 228 | dirtyRect.right >= width && dirtyRect.bottom >= height)) { |
| 229 | dirtyRect.set(0, 0, width, height); |
| 230 | } |
| 231 | |
Chris Craik | 51d6a3d | 2014-12-22 17:16:56 -0800 | [diff] [blame] | 232 | deferredList.reset(new DeferredDisplayList(dirtyRect)); |
Chris Craik | f57776b | 2013-10-25 18:30:17 -0700 | [diff] [blame] | 233 | |
Chris Craik | 28ce94a | 2013-05-31 11:38:03 -0700 | [diff] [blame] | 234 | DeferStateStruct deferredState(*deferredList, *renderer, |
John Reck | e18264b | 2014-03-12 13:56:30 -0700 | [diff] [blame] | 235 | RenderNode::kReplayFlag_ClipChildren); |
Chris Craik | 28ce94a | 2013-05-31 11:38:03 -0700 | [diff] [blame] | 236 | |
Chris Craik | 64e445b | 2015-09-02 14:23:49 -0700 | [diff] [blame] | 237 | renderer->setupFrameState(width, height, dirtyRect.left, dirtyRect.top, |
Romain Guy | 96885eb | 2013-03-26 15:05:58 -0700 | [diff] [blame] | 238 | dirtyRect.right, dirtyRect.bottom, !isBlend()); |
| 239 | |
Chris Craik | a7090e0 | 2014-06-20 16:01:00 -0700 | [diff] [blame] | 240 | renderNode->computeOrdering(); |
| 241 | renderNode->defer(deferredState, 0); |
Romain Guy | 02b49b7 | 2013-03-29 12:37:16 -0700 | [diff] [blame] | 242 | |
| 243 | deferredUpdateScheduled = false; |
Romain Guy | 96885eb | 2013-03-26 15:05:58 -0700 | [diff] [blame] | 244 | } |
| 245 | |
Romain Guy | e93482f | 2013-06-17 13:14:51 -0700 | [diff] [blame] | 246 | void Layer::cancelDefer() { |
Chris Craik | d41c4d8 | 2015-01-05 15:51:13 -0800 | [diff] [blame] | 247 | renderNode = nullptr; |
Romain Guy | e93482f | 2013-06-17 13:14:51 -0700 | [diff] [blame] | 248 | deferredUpdateScheduled = false; |
Sangkyu Lee | 441cc42 | 2015-12-11 16:05:10 +0900 | [diff] [blame] | 249 | deferredList.reset(nullptr); |
Romain Guy | e93482f | 2013-06-17 13:14:51 -0700 | [diff] [blame] | 250 | } |
| 251 | |
Romain Guy | 96885eb | 2013-03-26 15:05:58 -0700 | [diff] [blame] | 252 | void Layer::flush() { |
Chris Craik | 8c6e17c | 2013-06-17 13:02:12 -0700 | [diff] [blame] | 253 | // renderer is checked as layer may be destroyed/put in layer cache with flush scheduled |
| 254 | if (deferredList && renderer) { |
Chris Craik | 70850ea | 2014-11-18 10:49:23 -0800 | [diff] [blame] | 255 | ATRACE_LAYER_WORK("Issue"); |
Chris Craik | d41c4d8 | 2015-01-05 15:51:13 -0800 | [diff] [blame] | 256 | renderer->startMark((renderNode.get() != nullptr) ? renderNode->getName() : "Layer"); |
Chris Craik | 70850ea | 2014-11-18 10:49:23 -0800 | [diff] [blame] | 257 | |
Chris Craik | 64e445b | 2015-09-02 14:23:49 -0700 | [diff] [blame] | 258 | renderer->prepareDirty(layer.getWidth(), layer.getHeight(), |
| 259 | dirtyRect.left, dirtyRect.top, dirtyRect.right, dirtyRect.bottom, !isBlend()); |
Romain Guy | 96885eb | 2013-03-26 15:05:58 -0700 | [diff] [blame] | 260 | |
| 261 | deferredList->flush(*renderer, dirtyRect); |
| 262 | |
| 263 | renderer->finish(); |
Romain Guy | 96885eb | 2013-03-26 15:05:58 -0700 | [diff] [blame] | 264 | |
| 265 | dirtyRect.setEmpty(); |
Chris Craik | d41c4d8 | 2015-01-05 15:51:13 -0800 | [diff] [blame] | 266 | renderNode = nullptr; |
Chris Craik | 70850ea | 2014-11-18 10:49:23 -0800 | [diff] [blame] | 267 | |
| 268 | renderer->endMark(); |
Romain Guy | 96885eb | 2013-03-26 15:05:58 -0700 | [diff] [blame] | 269 | } |
| 270 | } |
| 271 | |
Chris Craik | 69e5adf | 2014-08-14 13:34:01 -0700 | [diff] [blame] | 272 | void Layer::render(const OpenGLRenderer& rootRenderer) { |
Chris Craik | 70850ea | 2014-11-18 10:49:23 -0800 | [diff] [blame] | 273 | ATRACE_LAYER_WORK("Direct-Issue"); |
| 274 | |
Chris Craik | 69e5adf | 2014-08-14 13:34:01 -0700 | [diff] [blame] | 275 | updateLightPosFromRenderer(rootRenderer); |
Chris Craik | 64e445b | 2015-09-02 14:23:49 -0700 | [diff] [blame] | 276 | renderer->prepareDirty(layer.getWidth(), layer.getHeight(), |
| 277 | dirtyRect.left, dirtyRect.top, dirtyRect.right, dirtyRect.bottom, !isBlend()); |
Romain Guy | 02b49b7 | 2013-03-29 12:37:16 -0700 | [diff] [blame] | 278 | |
Chris Craik | a7090e0 | 2014-06-20 16:01:00 -0700 | [diff] [blame] | 279 | renderer->drawRenderNode(renderNode.get(), dirtyRect, RenderNode::kReplayFlag_ClipChildren); |
Romain Guy | 02b49b7 | 2013-03-29 12:37:16 -0700 | [diff] [blame] | 280 | |
| 281 | renderer->finish(); |
Romain Guy | 02b49b7 | 2013-03-29 12:37:16 -0700 | [diff] [blame] | 282 | |
| 283 | dirtyRect.setEmpty(); |
| 284 | |
| 285 | deferredUpdateScheduled = false; |
Chris Craik | d41c4d8 | 2015-01-05 15:51:13 -0800 | [diff] [blame] | 286 | renderNode = nullptr; |
Romain Guy | 02b49b7 | 2013-03-29 12:37:16 -0700 | [diff] [blame] | 287 | } |
| 288 | |
John Reck | 0e89e2b | 2014-10-31 14:49:06 -0700 | [diff] [blame] | 289 | void Layer::postDecStrong() { |
| 290 | renderState.postDecStrong(this); |
| 291 | } |
| 292 | |
Chet Haase | d15ebf2 | 2012-09-05 11:40:29 -0700 | [diff] [blame] | 293 | }; // namespace uirenderer |
| 294 | }; // namespace android |