Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: ui/gl/async_pixel_transfer_delegate_android.cc

Issue 12390020: gpu: Finish after EGLImage creation on Qualcomm (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebased. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/async_pixel_transfer_delegate_android.cc
diff --git a/ui/gl/async_pixel_transfer_delegate_android.cc b/ui/gl/async_pixel_transfer_delegate_android.cc
index a1c7eb260ef4d7da1b9c9185834b41edde9277f6..85a4374ae93cadbeaade24ca5c0780d25e6547d3 100644
--- a/ui/gl/async_pixel_transfer_delegate_android.cc
+++ b/ui/gl/async_pixel_transfer_delegate_android.cc
@@ -184,6 +184,7 @@ class TransferStateInternal
public:
explicit TransferStateInternal(GLuint texture_id,
bool wait_for_uploads,
+ bool wait_for_creation,
bool use_image_preserved)
: texture_id_(texture_id),
thread_texture_id_(0),
@@ -191,6 +192,7 @@ class TransferStateInternal
transfer_completion_(true, true),
egl_image_(EGL_NO_IMAGE_KHR),
wait_for_uploads_(wait_for_uploads),
+ wait_for_creation_(wait_for_creation),
use_image_preserved_(use_image_preserved) {
static const AsyncTexImage2DParams zero_params = {0, 0, 0, 0, 0, 0, 0, 0};
late_bind_define_params_ = zero_params;
@@ -254,8 +256,13 @@ class TransferStateInternal
}
void CreateEglImageOnMainThreadIfNeeded() {
- if (egl_image_ == EGL_NO_IMAGE_KHR)
+ if (egl_image_ == EGL_NO_IMAGE_KHR) {
CreateEglImage(texture_id_);
+ if (wait_for_creation_) {
+ TRACE_EVENT0("gpu", "glFinish creation");
+ glFinish();
+ }
+ }
}
void WaitForLastUpload() {
@@ -323,6 +330,7 @@ class TransferStateInternal
// Customize when we block on fences (these are work-arounds).
bool wait_for_uploads_;
+ bool wait_for_creation_;
bool use_image_preserved_;
};
@@ -332,9 +340,11 @@ class AsyncTransferStateAndroid : public AsyncPixelTransferState {
public:
explicit AsyncTransferStateAndroid(GLuint texture_id,
bool wait_for_uploads,
+ bool wait_for_creation,
bool use_image_preserved)
: internal_(new TransferStateInternal(texture_id,
wait_for_uploads,
+ wait_for_creation,
use_image_preserved)) {
}
virtual ~AsyncTransferStateAndroid() {}
@@ -454,6 +464,11 @@ AsyncPixelTransferState*
// In practice, they are complete when the CPU glTexSubImage2D completes.
bool wait_for_uploads = !is_imagination_;
+ // Qualcomm runs into texture corruption problems if the same texture is
+ // uploaded to with both async and normal uploads. Synchronize after EGLImage
+ // creation on the main thread as a work-around.
+ bool wait_for_creation = is_qualcomm_;
+
// Qualcomm has a race when using image_preserved=FALSE,
// which can result in black textures even after the first upload.
// Since using FALSE is mainly for performance (to avoid layout changes),
@@ -464,6 +479,7 @@ AsyncPixelTransferState*
return static_cast<AsyncPixelTransferState*>(
new AsyncTransferStateAndroid(texture_id,
wait_for_uploads,
+ wait_for_creation,
use_image_preserved));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698