blob: 72af7c98e4777208504d5d07d5e5fa1500176bb3 [file] [log] [blame]
John Reck3b202512014-06-23 13:13:08 -07001/*
2 * Copyright (C) 2014 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 */
John Reck38e0c322015-11-10 12:19:17 -080016#include <GpuMemoryTracker.h>
Chris Craik96a5c4c2015-01-27 15:46:35 -080017#include "renderstate/RenderState.h"
John Reck3b202512014-06-23 13:13:08 -070018
John Reck443a7142014-09-04 17:40:05 -070019#include "renderthread/CanvasContext.h"
John Reck0e89e2b2014-10-31 14:49:06 -070020#include "renderthread/EglManager.h"
Chris Craik117bdbc2015-02-05 10:12:38 -080021#include "utils/GLUtils.h"
Chris Craik9db58c02015-08-19 15:19:18 -070022#include <algorithm>
23
John Reck3b202512014-06-23 13:13:08 -070024namespace android {
25namespace uirenderer {
26
John Reck0e89e2b2014-10-31 14:49:06 -070027RenderState::RenderState(renderthread::RenderThread& thread)
28 : mRenderThread(thread)
John Reck3b202512014-06-23 13:13:08 -070029 , mViewportWidth(0)
30 , mViewportHeight(0)
31 , mFramebuffer(0) {
John Reck0e89e2b2014-10-31 14:49:06 -070032 mThreadId = pthread_self();
John Reck3b202512014-06-23 13:13:08 -070033}
34
35RenderState::~RenderState() {
Chris Craik44eb2c02015-01-29 09:45:09 -080036 LOG_ALWAYS_FATAL_IF(mBlend || mMeshState || mScissor || mStencil,
Chris Craik96a5c4c2015-01-27 15:46:35 -080037 "State object lifecycle not managed correctly");
John Reck3b202512014-06-23 13:13:08 -070038}
39
40void RenderState::onGLContextCreated() {
Chris Craik44eb2c02015-01-29 09:45:09 -080041 LOG_ALWAYS_FATAL_IF(mBlend || mMeshState || mScissor || mStencil,
Chris Craik96a5c4c2015-01-27 15:46:35 -080042 "State object lifecycle not managed correctly");
John Reck38e0c322015-11-10 12:19:17 -080043 GpuMemoryTracker::onGLContextCreated();
44
Chris Craik44eb2c02015-01-29 09:45:09 -080045 mBlend = new Blend();
Chris Craik96a5c4c2015-01-27 15:46:35 -080046 mMeshState = new MeshState();
47 mScissor = new Scissor();
48 mStencil = new Stencil();
Chris Craik65fe5ee2015-01-26 18:06:29 -080049
Chris Craik96a5c4c2015-01-27 15:46:35 -080050 // This is delayed because the first access of Caches makes GL calls
Chris Craikff5c8e82015-01-30 09:46:18 -080051 if (!mCaches) {
52 mCaches = &Caches::createInstance(*this);
53 }
Chris Craik96a5c4c2015-01-27 15:46:35 -080054 mCaches->init();
John Reck3b202512014-06-23 13:13:08 -070055}
56
John Reck49bc4ac2015-01-29 12:53:38 -080057static void layerLostGlContext(Layer* layer) {
58 layer->onGlContextLost();
59}
60
Chris Craik1d477422014-08-26 17:30:15 -070061void RenderState::onGLContextDestroyed() {
Chris Craik9fded232015-11-11 16:42:34 -080062 mLayerPool.clear();
63
Chris Craik96a5c4c2015-01-27 15:46:35 -080064 // TODO: reset all cached state in state objects
John Reck49bc4ac2015-01-29 12:53:38 -080065 std::for_each(mActiveLayers.begin(), mActiveLayers.end(), layerLostGlContext);
Chris Craik96a5c4c2015-01-27 15:46:35 -080066
Chris Craik44eb2c02015-01-29 09:45:09 -080067 mCaches->terminate();
68
69 delete mBlend;
70 mBlend = nullptr;
Chris Craik96a5c4c2015-01-27 15:46:35 -080071 delete mMeshState;
72 mMeshState = nullptr;
73 delete mScissor;
74 mScissor = nullptr;
75 delete mStencil;
76 mStencil = nullptr;
John Reck38e0c322015-11-10 12:19:17 -080077
78 GpuMemoryTracker::onGLContextDestroyed();
Chris Craik1d477422014-08-26 17:30:15 -070079}
80
Chris Craik9fded232015-11-11 16:42:34 -080081void RenderState::flush(Caches::FlushMode mode) {
82 switch (mode) {
83 case Caches::FlushMode::Full:
84 // fall through
85 case Caches::FlushMode::Moderate:
86 // fall through
87 case Caches::FlushMode::Layers:
88 mLayerPool.clear();
89 break;
90 }
91 mCaches->flush(mode);
92}
93
John Reck3b202512014-06-23 13:13:08 -070094void RenderState::setViewport(GLsizei width, GLsizei height) {
95 mViewportWidth = width;
96 mViewportHeight = height;
97 glViewport(0, 0, mViewportWidth, mViewportHeight);
98}
99
100
101void RenderState::getViewport(GLsizei* outWidth, GLsizei* outHeight) {
102 *outWidth = mViewportWidth;
103 *outHeight = mViewportHeight;
104}
105
106void RenderState::bindFramebuffer(GLuint fbo) {
107 if (mFramebuffer != fbo) {
108 mFramebuffer = fbo;
109 glBindFramebuffer(GL_FRAMEBUFFER, mFramebuffer);
110 }
111}
112
John Reck0b8d0672016-01-29 14:18:22 -0800113GLuint RenderState::createFramebuffer() {
Chris Craik818c9fb2015-10-23 14:33:42 -0700114 GLuint ret;
115 glGenFramebuffers(1, &ret);
116 return ret;
117}
118
119void RenderState::deleteFramebuffer(GLuint fbo) {
120 if (mFramebuffer == fbo) {
121 // GL defines that deleting the currently bound FBO rebinds FBO 0.
122 // Reflect this in our cached value.
123 mFramebuffer = 0;
124 }
125 glDeleteFramebuffers(1, &fbo);
126}
127
John Reck3b202512014-06-23 13:13:08 -0700128void RenderState::invokeFunctor(Functor* functor, DrawGlInfo::Mode mode, DrawGlInfo* info) {
John Reck95cd24b2015-08-04 11:17:39 -0700129 if (mode == DrawGlInfo::kModeProcessNoContext) {
130 // If there's no context we don't need to interrupt as there's
131 // no gl state to save/restore
132 (*functor)(mode, info);
133 } else {
134 interruptForFunctorInvoke();
135 (*functor)(mode, info);
136 resumeFromFunctorInvoke();
137 }
John Reck3b202512014-06-23 13:13:08 -0700138}
139
140void RenderState::interruptForFunctorInvoke() {
Chris Craik6c15ffa2015-02-02 13:50:55 -0800141 mCaches->setProgram(nullptr);
Chris Craik44eb2c02015-01-29 09:45:09 -0800142 mCaches->textureState().resetActiveTexture();
Chris Craik96a5c4c2015-01-27 15:46:35 -0800143 meshState().unbindMeshBuffer();
144 meshState().unbindIndicesBuffer();
145 meshState().resetVertexPointers();
146 meshState().disableTexCoordsVertexArray();
John Reck3b202512014-06-23 13:13:08 -0700147 debugOverdraw(false, false);
Romain Guy253f2c22016-09-28 17:34:42 -0700148 // TODO: We need a way to know whether the functor is sRGB aware (b/32072673)
149 if (mCaches->extensions().hasSRGBWriteControl()) {
150 glDisable(GL_FRAMEBUFFER_SRGB_EXT);
151 }
John Reck3b202512014-06-23 13:13:08 -0700152}
153
154void RenderState::resumeFromFunctorInvoke() {
Romain Guy253f2c22016-09-28 17:34:42 -0700155 if (mCaches->extensions().hasSRGBWriteControl()) {
156 glEnable(GL_FRAMEBUFFER_SRGB_EXT);
157 }
158
John Reck3b202512014-06-23 13:13:08 -0700159 glViewport(0, 0, mViewportWidth, mViewportHeight);
160 glBindFramebuffer(GL_FRAMEBUFFER, mFramebuffer);
161 debugOverdraw(false, false);
162
163 glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
164
Chris Craik65fe5ee2015-01-26 18:06:29 -0800165 scissor().invalidate();
Chris Craik44eb2c02015-01-29 09:45:09 -0800166 blend().invalidate();
John Reck3b202512014-06-23 13:13:08 -0700167
Chris Craik44eb2c02015-01-29 09:45:09 -0800168 mCaches->textureState().activateTexture(0);
169 mCaches->textureState().resetBoundTextures();
John Reck3b202512014-06-23 13:13:08 -0700170}
171
172void RenderState::debugOverdraw(bool enable, bool clear) {
Chris Craik2507c342015-05-04 14:36:49 -0700173 if (Properties::debugOverdraw && mFramebuffer == 0) {
John Reck3b202512014-06-23 13:13:08 -0700174 if (clear) {
Chris Craik65fe5ee2015-01-26 18:06:29 -0800175 scissor().setEnabled(false);
Chris Craik96a5c4c2015-01-27 15:46:35 -0800176 stencil().clear();
John Reck3b202512014-06-23 13:13:08 -0700177 }
178 if (enable) {
Chris Craik96a5c4c2015-01-27 15:46:35 -0800179 stencil().enableDebugWrite();
John Reck3b202512014-06-23 13:13:08 -0700180 } else {
Chris Craik96a5c4c2015-01-27 15:46:35 -0800181 stencil().disable();
John Reck3b202512014-06-23 13:13:08 -0700182 }
183 }
184}
185
John Reck0e89e2b2014-10-31 14:49:06 -0700186class DecStrongTask : public renderthread::RenderTask {
187public:
Chih-Hung Hsiehc6baf562016-04-27 11:29:23 -0700188 explicit DecStrongTask(VirtualLightRefBase* object) : mObject(object) {}
John Reck0e89e2b2014-10-31 14:49:06 -0700189
Chris Craikd41c4d82015-01-05 15:51:13 -0800190 virtual void run() override {
191 mObject->decStrong(nullptr);
192 mObject = nullptr;
John Reck0e89e2b2014-10-31 14:49:06 -0700193 delete this;
194 }
195
196private:
197 VirtualLightRefBase* mObject;
198};
199
200void RenderState::postDecStrong(VirtualLightRefBase* object) {
John Recka55b5d62016-01-14 15:09:10 -0800201 if (pthread_equal(mThreadId, pthread_self())) {
202 object->decStrong(nullptr);
203 } else {
204 mRenderThread.queue(new DecStrongTask(object));
205 }
John Reck0e89e2b2014-10-31 14:49:06 -0700206}
207
Chris Craik6c15ffa2015-02-02 13:50:55 -0800208///////////////////////////////////////////////////////////////////////////////
209// Render
210///////////////////////////////////////////////////////////////////////////////
211
Chris Craik12efe642015-09-28 15:52:12 -0700212void RenderState::render(const Glop& glop, const Matrix4& orthoMatrix) {
Chris Craik6c15ffa2015-02-02 13:50:55 -0800213 const Glop::Mesh& mesh = glop.mesh;
Chris Craikef250742015-02-25 17:16:16 -0800214 const Glop::Mesh::Vertices& vertices = mesh.vertices;
215 const Glop::Mesh::Indices& indices = mesh.indices;
Chris Craik0519c812015-02-11 13:17:06 -0800216 const Glop::Fill& fill = glop.fill;
Chris Craik6c15ffa2015-02-02 13:50:55 -0800217
John Reck975591a2016-01-22 16:28:07 -0800218 GL_CHECKPOINT(MODERATE);
John Reck9372ac32016-01-19 11:46:52 -0800219
Chris Craik0519c812015-02-11 13:17:06 -0800220 // ---------------------------------------------
221 // ---------- Program + uniform setup ----------
222 // ---------------------------------------------
223 mCaches->setProgram(fill.program);
Chris Craik6c15ffa2015-02-02 13:50:55 -0800224
Chris Craik0519c812015-02-11 13:17:06 -0800225 if (fill.colorEnabled) {
226 fill.program->setColor(fill.color);
227 }
Chris Craik6c15ffa2015-02-02 13:50:55 -0800228
Chris Craik12efe642015-09-28 15:52:12 -0700229 fill.program->set(orthoMatrix,
Chris Craik6c15ffa2015-02-02 13:50:55 -0800230 glop.transform.modelView,
Chris Craik53e51e42015-06-01 10:35:35 -0700231 glop.transform.meshTransform(),
232 glop.transform.transformFlags & TransformFlags::OffsetByFudgeFactor);
Chris Craik6c15ffa2015-02-02 13:50:55 -0800233
Chris Craik0519c812015-02-11 13:17:06 -0800234 // Color filter uniforms
Chris Craikb9ce116d2015-08-20 15:14:06 -0700235 if (fill.filterMode == ProgramDescription::ColorFilterMode::Blend) {
Chris Craikef250742015-02-25 17:16:16 -0800236 const FloatColor& color = fill.filter.color;
Chris Craik117bdbc2015-02-05 10:12:38 -0800237 glUniform4f(mCaches->program().getUniform("colorBlend"),
238 color.r, color.g, color.b, color.a);
Chris Craikb9ce116d2015-08-20 15:14:06 -0700239 } else if (fill.filterMode == ProgramDescription::ColorFilterMode::Matrix) {
Chris Craik117bdbc2015-02-05 10:12:38 -0800240 glUniformMatrix4fv(mCaches->program().getUniform("colorMatrix"), 1, GL_FALSE,
Chris Craikef250742015-02-25 17:16:16 -0800241 fill.filter.matrix.matrix);
Chris Craik117bdbc2015-02-05 10:12:38 -0800242 glUniform4fv(mCaches->program().getUniform("colorMatrixVector"), 1,
Chris Craikef250742015-02-25 17:16:16 -0800243 fill.filter.matrix.vector);
Chris Craik117bdbc2015-02-05 10:12:38 -0800244 }
245
Chris Craik0519c812015-02-11 13:17:06 -0800246 // Round rect clipping uniforms
247 if (glop.roundRectClipState) {
248 // TODO: avoid query, and cache values (or RRCS ptr) in program
249 const RoundRectClipState* state = glop.roundRectClipState;
250 const Rect& innerRect = state->innerRect;
251 glUniform4f(fill.program->getUniform("roundRectInnerRectLTRB"),
252 innerRect.left, innerRect.top,
253 innerRect.right, innerRect.bottom);
254 glUniformMatrix4fv(fill.program->getUniform("roundRectInvTransform"),
255 1, GL_FALSE, &state->matrix.data[0]);
256
257 // add half pixel to round out integer rect space to cover pixel centers
258 float roundedOutRadius = state->radius + 0.5f;
259 glUniform1f(fill.program->getUniform("roundRectRadius"),
260 roundedOutRadius);
261 }
Chris Craikef250742015-02-25 17:16:16 -0800262
John Reck975591a2016-01-22 16:28:07 -0800263 GL_CHECKPOINT(MODERATE);
John Reck9372ac32016-01-19 11:46:52 -0800264
Chris Craik117bdbc2015-02-05 10:12:38 -0800265 // --------------------------------
Chris Craik6c15ffa2015-02-02 13:50:55 -0800266 // ---------- Mesh setup ----------
Chris Craik117bdbc2015-02-05 10:12:38 -0800267 // --------------------------------
268 // vertices
Chris Craik1b7db402016-02-24 18:25:32 -0800269 meshState().bindMeshBuffer(vertices.bufferObject);
270 meshState().bindPositionVertexPointer(vertices.position, vertices.stride);
Chris Craik117bdbc2015-02-05 10:12:38 -0800271
272 // indices
Chris Craik1b7db402016-02-24 18:25:32 -0800273 meshState().bindIndicesBuffer(indices.bufferObject);
Chris Craik117bdbc2015-02-05 10:12:38 -0800274
Chris Craik138c21f2016-04-28 16:59:42 -0700275 // texture
276 if (fill.texture.texture != nullptr) {
Chris Craik26bf3422015-02-26 16:28:17 -0800277 const Glop::Fill::TextureData& texture = fill.texture;
278 // texture always takes slot 0, shader samplers increment from there
Chris Craik0519c812015-02-11 13:17:06 -0800279 mCaches->textureState().activateTexture(0);
280
sergeyv2a38c422016-10-25 15:21:50 -0700281 mCaches->textureState().bindTexture(texture.texture->target(), texture.texture->id());
Chris Craik26bf3422015-02-26 16:28:17 -0800282 if (texture.clamp != GL_INVALID_ENUM) {
sergeyv2a38c422016-10-25 15:21:50 -0700283 texture.texture->setWrap(texture.clamp, false, false);
Chris Craik30036092015-02-12 10:41:39 -0800284 }
Chris Craik26bf3422015-02-26 16:28:17 -0800285 if (texture.filter != GL_INVALID_ENUM) {
sergeyv2a38c422016-10-25 15:21:50 -0700286 texture.texture->setFilter(texture.filter, false, false);
Chris Craik30036092015-02-12 10:41:39 -0800287 }
Chris Craik0519c812015-02-11 13:17:06 -0800288
Chris Craik26bf3422015-02-26 16:28:17 -0800289 if (texture.textureTransform) {
290 glUniformMatrix4fv(fill.program->getUniform("mainTextureTransform"), 1,
291 GL_FALSE, &texture.textureTransform->data[0]);
292 }
Chris Craik138c21f2016-04-28 16:59:42 -0700293 }
294
295 // vertex attributes (tex coord, color, alpha)
296 if (vertices.attribFlags & VertexAttribFlags::TextureCoord) {
297 meshState().enableTexCoordsVertexArray();
298 meshState().bindTexCoordsVertexPointer(vertices.texCoord, vertices.stride);
Chris Craik6c15ffa2015-02-02 13:50:55 -0800299 } else {
300 meshState().disableTexCoordsVertexArray();
301 }
Chris Craikef250742015-02-25 17:16:16 -0800302 int colorLocation = -1;
Chris Craik53e51e42015-06-01 10:35:35 -0700303 if (vertices.attribFlags & VertexAttribFlags::Color) {
Chris Craikef250742015-02-25 17:16:16 -0800304 colorLocation = fill.program->getAttrib("colors");
305 glEnableVertexAttribArray(colorLocation);
306 glVertexAttribPointer(colorLocation, 4, GL_FLOAT, GL_FALSE, vertices.stride, vertices.color);
Chris Craik6c15ffa2015-02-02 13:50:55 -0800307 }
Chris Craikef250742015-02-25 17:16:16 -0800308 int alphaLocation = -1;
Chris Craik53e51e42015-06-01 10:35:35 -0700309 if (vertices.attribFlags & VertexAttribFlags::Alpha) {
Chris Craikef250742015-02-25 17:16:16 -0800310 // NOTE: alpha vertex position is computed assuming no VBO
311 const void* alphaCoords = ((const GLbyte*) vertices.position) + kVertexAlphaOffset;
312 alphaLocation = fill.program->getAttrib("vtxAlpha");
313 glEnableVertexAttribArray(alphaLocation);
314 glVertexAttribPointer(alphaLocation, 1, GL_FLOAT, GL_FALSE, vertices.stride, alphaCoords);
Chris Craik6c15ffa2015-02-02 13:50:55 -0800315 }
Chris Craik922d3a72015-02-13 17:47:21 -0800316 // Shader uniforms
Romain Guy253f2c22016-09-28 17:34:42 -0700317 SkiaShader::apply(*mCaches, fill.skiaShaderData, mViewportWidth, mViewportHeight);
Chris Craik922d3a72015-02-13 17:47:21 -0800318
John Reck975591a2016-01-22 16:28:07 -0800319 GL_CHECKPOINT(MODERATE);
Dohyun Leec5a3efd2016-01-21 13:46:21 +0900320 Texture* texture = (fill.skiaShaderData.skiaShaderType & kBitmap_SkiaShaderType) ?
321 fill.skiaShaderData.bitmapData.bitmapTexture : nullptr;
322 const AutoTexture autoCleanup(texture);
John Reck9372ac32016-01-19 11:46:52 -0800323
Chris Craik117bdbc2015-02-05 10:12:38 -0800324 // ------------------------------------
Chris Craik6c15ffa2015-02-02 13:50:55 -0800325 // ---------- GL state setup ----------
Chris Craik117bdbc2015-02-05 10:12:38 -0800326 // ------------------------------------
Chris Craik03188872015-02-02 18:39:33 -0800327 blend().setFactors(glop.blend.src, glop.blend.dst);
Chris Craik6c15ffa2015-02-02 13:50:55 -0800328
John Reck975591a2016-01-22 16:28:07 -0800329 GL_CHECKPOINT(MODERATE);
John Reck9372ac32016-01-19 11:46:52 -0800330
Chris Craik117bdbc2015-02-05 10:12:38 -0800331 // ------------------------------------
Chris Craik2ab95d72015-02-06 15:25:51 -0800332 // ---------- Actual drawing ----------
Chris Craik117bdbc2015-02-05 10:12:38 -0800333 // ------------------------------------
Chris Craikef250742015-02-25 17:16:16 -0800334 if (indices.bufferObject == meshState().getQuadListIBO()) {
Chris Craik2ab95d72015-02-06 15:25:51 -0800335 // Since the indexed quad list is of limited length, we loop over
336 // the glDrawXXX method while updating the vertex pointer
Chris Craik0519c812015-02-11 13:17:06 -0800337 GLsizei elementsCount = mesh.elementCount;
Chris Craikef250742015-02-25 17:16:16 -0800338 const GLbyte* vertexData = static_cast<const GLbyte*>(vertices.position);
Chris Craik2ab95d72015-02-06 15:25:51 -0800339 while (elementsCount > 0) {
Chris Craik9db58c02015-08-19 15:19:18 -0700340 GLsizei drawCount = std::min(elementsCount, (GLsizei) kMaxNumberOfQuads * 6);
Chris Craik1b7db402016-02-24 18:25:32 -0800341 meshState().bindPositionVertexPointer(vertexData, vertices.stride);
Chris Craik53e51e42015-06-01 10:35:35 -0700342 if (vertices.attribFlags & VertexAttribFlags::TextureCoord) {
Chris Craik1b7db402016-02-24 18:25:32 -0800343 meshState().bindTexCoordsVertexPointer(
Chris Craikef250742015-02-25 17:16:16 -0800344 vertexData + kMeshTextureOffset, vertices.stride);
Chris Craikf27133d2015-02-19 09:51:53 -0800345 }
346
Chris Craik2ab95d72015-02-06 15:25:51 -0800347 glDrawElements(mesh.primitiveMode, drawCount, GL_UNSIGNED_SHORT, nullptr);
348 elementsCount -= drawCount;
Chris Craikef250742015-02-25 17:16:16 -0800349 vertexData += (drawCount / 6) * 4 * vertices.stride;
Chris Craik2ab95d72015-02-06 15:25:51 -0800350 }
Chris Craikef250742015-02-25 17:16:16 -0800351 } else if (indices.bufferObject || indices.indices) {
352 glDrawElements(mesh.primitiveMode, mesh.elementCount, GL_UNSIGNED_SHORT, indices.indices);
Chris Craik6c15ffa2015-02-02 13:50:55 -0800353 } else {
Chris Craik0519c812015-02-11 13:17:06 -0800354 glDrawArrays(mesh.primitiveMode, 0, mesh.elementCount);
Chris Craik6c15ffa2015-02-02 13:50:55 -0800355 }
Chris Craik117bdbc2015-02-05 10:12:38 -0800356
John Reck975591a2016-01-22 16:28:07 -0800357 GL_CHECKPOINT(MODERATE);
John Reck9372ac32016-01-19 11:46:52 -0800358
Chris Craik2ab95d72015-02-06 15:25:51 -0800359 // -----------------------------------
360 // ---------- Mesh teardown ----------
361 // -----------------------------------
Chris Craik53e51e42015-06-01 10:35:35 -0700362 if (vertices.attribFlags & VertexAttribFlags::Alpha) {
Chris Craikef250742015-02-25 17:16:16 -0800363 glDisableVertexAttribArray(alphaLocation);
364 }
Chris Craik53e51e42015-06-01 10:35:35 -0700365 if (vertices.attribFlags & VertexAttribFlags::Color) {
Chris Craikef250742015-02-25 17:16:16 -0800366 glDisableVertexAttribArray(colorLocation);
Chris Craik117bdbc2015-02-05 10:12:38 -0800367 }
John Reck9372ac32016-01-19 11:46:52 -0800368
John Reck975591a2016-01-22 16:28:07 -0800369 GL_CHECKPOINT(MODERATE);
Chris Craik117bdbc2015-02-05 10:12:38 -0800370}
371
372void RenderState::dump() {
373 blend().dump();
374 meshState().dump();
375 scissor().dump();
376 stencil().dump();
Chris Craik6c15ffa2015-02-02 13:50:55 -0800377}
378
John Reck3b202512014-06-23 13:13:08 -0700379} /* namespace uirenderer */
380} /* namespace android */