• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

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

frameworks/base


Commit MetaInfo

修訂35bbf0c06bfe3feccd62a742f4aca7bb26c45850 (tree)
時間2013-09-25 11:48:22
作者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>

Change Summary

差異

--- a/libs/hwui/LayerRenderer.cpp
+++ b/libs/hwui/LayerRenderer.cpp
@@ -255,12 +255,28 @@ Layer* LayerRenderer::createLayer(uint32_t width, uint32_t height, bool isOpaque
255255
256256 // Initialize the texture if needed
257257 if (layer->isEmpty()) {
258+ int an_error;
259+ int num_errors;
260+ /*
261+ * Make sure there is no stale error leftover from some previous code
262+ * sequence before we embark on this series of gl operations.
263+ */
264+ while ((an_error = glGetError()) != GL_NO_ERROR) {
265+ ALOGD("createLayer clearing stale error code 0x%04x", an_error);
266+ }
267+
258268 layer->setEmpty(false);
259269 layer->allocateTexture();
260270
261- // This should only happen if we run out of memory
262- if (glGetError() != GL_NO_ERROR) {
263- ALOGE("Could not allocate texture for layer (fbo=%d %dx%d)", fbo, width, height);
271+ /* Detect and clear errors from setEmpty(), allocateTexture() */
272+ num_errors = 0;
273+ while ((an_error = glGetError()) != GL_NO_ERROR) {
274+ num_errors++;
275+ ALOGD("Could not allocate texture for layer (fbo=%d %dx%d)"
276+ " (error=0x%04x)",
277+ fbo, width, height, an_error);
278+ }
279+ if (num_errors != 0) {
264280 glBindFramebuffer(GL_FRAMEBUFFER, previousFbo);
265281 caches.resourceCache.decrementRefcount(layer);
266282 return NULL;