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

Unified Diff: content/common/gpu/client/gl_helper.cc

Issue 10078002: aura: Add flush() to make sure delete operations make it through when we intend. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « content/browser/renderer_host/image_transport_factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/gl_helper.cc
diff --git a/content/common/gpu/client/gl_helper.cc b/content/common/gpu/client/gl_helper.cc
index ca91b84c081f3c0049e61193038255f02383fa63..3c4c889261158599262d5c4dce9c50d281aaa528 100644
--- a/content/common/gpu/client/gl_helper.cc
+++ b/content/common/gpu/client/gl_helper.cc
@@ -191,6 +191,22 @@ class ScopedTextureBinder : ScopedBinder<target> {
&WebKit::WebGraphicsContext3D::bindTexture) {}
};
+class ScopedFlush {
+ public:
+ ScopedFlush(WebKit::WebGraphicsContext3D* context)
+ : context_(context) {
+ }
+
+ virtual ~ScopedFlush() {
+ context_->flush();
+ }
+
+ private:
+ WebKit::WebGraphicsContext3D* context_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedFlush);
+};
+
void ReadBackFramebuffer(
WebKit::WebGraphicsContext3D* context,
unsigned char* pixels,
@@ -202,6 +218,7 @@ void ReadBackFramebuffer(
return;
if (context->isContextLost())
return;
+ ScopedFlush flush(context);
ScopedFramebuffer dst_framebuffer(context, context->createFramebuffer());
{
ScopedFramebufferBinder<GL_DRAW_FRAMEBUFFER> framebuffer_binder(
@@ -220,7 +237,6 @@ void ReadBackFramebuffer(
static_cast<WebKit::WebGLId>(dst_framebuffer),
size.width(),
size.height());
- context->flush();
}
void ReadBackFramebufferComplete(WebKit::WebGraphicsContext3D* context,
@@ -230,6 +246,7 @@ void ReadBackFramebufferComplete(WebKit::WebGraphicsContext3D* context,
callback.Run(*result);
if (*dst_texture != 0) {
context->deleteTexture(*dst_texture);
+ context->flush();
*dst_texture = 0;
}
}
@@ -454,6 +471,7 @@ bool GLHelper::CopyTextureToImpl::CopyTextureTo(
const gfx::Size& src_size,
const gfx::Size& dst_size,
unsigned char* out) {
+ ScopedFlush flush(context_);
ScopedTexture dst_texture(context_,
ScaleTexture(src_texture, src_size, dst_size));
ScopedFramebuffer dst_framebuffer(context_, context_->createFramebuffer());
« no previous file with comments | « content/browser/renderer_host/image_transport_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698