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

Unified Diff: content/common/gpu/texture_image_transport_surface.cc

Issue 10690168: Aura: Resize locks with --ui-enable-threaded-compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New approach. Created 8 years, 5 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
Index: content/common/gpu/texture_image_transport_surface.cc
diff --git a/content/common/gpu/texture_image_transport_surface.cc b/content/common/gpu/texture_image_transport_surface.cc
index 652e525d824f85fc959d50a2f9222a6fb562e39b..3aba85d9841e548466688200b816c9e53a65305e 100644
--- a/content/common/gpu/texture_image_transport_surface.cc
+++ b/content/common/gpu/texture_image_transport_surface.cc
@@ -232,13 +232,10 @@ bool TextureImageTransportSurface::SwapBuffers() {
}
glFlush();
- front_ = back();
- previous_damage_rect_ = gfx::Rect(textures_[front()].size);
-
- DCHECK(textures_[front()].client_id != 0);
+ previous_damage_rect_ = gfx::Rect(textures_[back()].size);
GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params;
- params.surface_handle = textures_[front()].client_id;
+ params.surface_handle = textures_[back()].client_id;
params.protection_state_id = protection_state_id_;
params.skip_ack = false;
helper_->SendAcceleratedSurfaceBuffersSwapped(params);
@@ -298,13 +295,10 @@ bool TextureImageTransportSurface::PostSubBuffer(
}
glFlush();
- front_ = back();
previous_damage_rect_ = new_damage_rect;
- DCHECK(textures_[front()].client_id);
-
GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params params;
- params.surface_handle = textures_[front()].client_id;
+ params.surface_handle = textures_[back()].client_id;
params.x = x;
params.y = y;
params.width = width;
@@ -361,7 +355,12 @@ void TextureImageTransportSurface::OnSetFrontSurfaceIsProtected(
void TextureImageTransportSurface::OnBufferPresented(uint32 sync_point) {
if (sync_point == 0) {
- BufferPresentedImpl();
+ // We could do this many times in a row, so play it safe with the damage.
+ // No real performance hit because we're typically fast tracking resize
+ // where damage tracking is a no-op.
+ previous_damage_rect_ = gfx::Rect(textures_[front_].size);
+ AttachBackTextureToFBO();
+ helper_->SetScheduled(true);
} else {
helper_->manager()->sync_point_manager()->AddSyncPointCallback(
sync_point,
@@ -371,6 +370,9 @@ void TextureImageTransportSurface::OnBufferPresented(uint32 sync_point) {
}
void TextureImageTransportSurface::BufferPresentedImpl() {
+ front_ = back();
piman 2012/07/31 23:42:17 Mmh, is it ok to move this here wrt e.g. dropping
jonathan.backer 2012/08/01 17:22:43 Done.
+ DCHECK(textures_[front()].client_id);
+
// We're relying on the fact that the parent context is
// finished with it's context when it inserts the sync point that
// triggers this callback.

Powered by Google App Engine
This is Rietveld 408576698