• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

修订版85218b55bde8f2f71535e6b362dc437238820149 (tree)
时间2014-08-27 19:18:36
作者Paul Drews <paul.drews@inte...>
CommiterChih-Wei Huang

Log Message

Clear any stale errors before allocating layer

Symptom: On first boot, the "Make yourself at home" dialog
was not drawn, but was actually present. This prevented
swiping the home screen until you happened to click on the
invisible "OK" button or take some other action that caused
the screen to get redrawn.

Cause: GL errors remain within GL until they are cleared by
retrieving them. The createLayer function was affected by a
stale error leftover from some previous code sequence. When
it retrieved GL error status to check for success/fail of an
operation it got one of these "stale" errors and erroneously
concluded that the operation had failed.

This change clears any stale errors before embarking the
operation sequence that it wants to check for success/fail.

Issue: AXIA-425
Change-Id: I30b7fe1fbc354d3fea5e1d8cefa1be363fc68f8c
Signed-off-by: Paul Drews <paul.drews@intel.com>

更改概述

差异

--- a/libs/hwui/LayerRenderer.cpp
+++ b/libs/hwui/LayerRenderer.cpp
@@ -234,12 +234,28 @@ Layer* LayerRenderer::createLayer(uint32_t width, uint32_t height, bool isOpaque
234234
235235 // Initialize the texture if needed
236236 if (layer->isEmpty()) {
237+ int an_error;
238+ int num_errors;
239+ /*
240+ * Make sure there is no stale error leftover from some previous code
241+ * sequence before we embark on this series of gl operations.
242+ */
243+ while ((an_error = glGetError()) != GL_NO_ERROR) {
244+ ALOGD("createLayer clearing stale error code 0x%04x", an_error);
245+ }
246+
237247 layer->setEmpty(false);
238248 layer->allocateTexture();
239249
240- // This should only happen if we run out of memory
241- if (glGetError() != GL_NO_ERROR) {
242- ALOGE("Could not allocate texture for layer (fbo=%d %dx%d)", fbo, width, height);
250+ /* Detect and clear errors from setEmpty(), allocateTexture() */
251+ num_errors = 0;
252+ while ((an_error = glGetError()) != GL_NO_ERROR) {
253+ num_errors++;
254+ ALOGD("Could not allocate texture for layer (fbo=%d %dx%d)"
255+ " (error=0x%04x)",
256+ fbo, width, height, an_error);
257+ }
258+ if (num_errors != 0) {
243259 glBindFramebuffer(GL_FRAMEBUFFER, previousFbo);
244260 caches.resourceCache.decrementRefcount(layer);
245261 return NULL;