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

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: OSX compile fix. Created 8 years, 2 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/common/gpu/texture_image_transport_surface.h ('k') | ui/aura/bench/bench_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ab0a27636b7a92b7e7cd41036c4a27c709016bce..ec9aeb41e6400232d8596a01a6c8fda2a1808d01 100644
--- a/content/common/gpu/texture_image_transport_surface.cc
+++ b/content/common/gpu/texture_image_transport_surface.cc
@@ -46,7 +46,8 @@ TextureImageTransportSurface::TextureImageTransportSurface(
handle_(handle),
parent_stub_(NULL),
is_swap_buffers_pending_(false),
- did_unschedule_(false) {
+ did_unschedule_(false),
+ did_flip_(false) {
helper_.reset(new ImageTransportHelper(this,
manager,
stub,
@@ -323,7 +324,7 @@ bool TextureImageTransportSurface::PostSubBuffer(
region_to_copy.width(), region_to_copy.height());
}
}
- } else {
+ } else if (!surfaces_same_size && did_flip_) {
DCHECK(new_damage_rect == gfx::Rect(expected_size));
}
@@ -391,21 +392,35 @@ void TextureImageTransportSurface::OnSetFrontSurfaceIsProtected(
}
}
-void TextureImageTransportSurface::OnBufferPresented(uint32 sync_point) {
+void TextureImageTransportSurface::OnBufferPresented(bool presented,
+ uint32 sync_point) {
if (sync_point == 0) {
- BufferPresentedImpl();
+ BufferPresentedImpl(presented);
} else {
helper_->manager()->sync_point_manager()->AddSyncPointCallback(
sync_point,
base::Bind(&TextureImageTransportSurface::BufferPresentedImpl,
- this->AsWeakPtr()));
+ this->AsWeakPtr(),
+ presented));
}
}
-void TextureImageTransportSurface::BufferPresentedImpl() {
+void TextureImageTransportSurface::BufferPresentedImpl(bool presented) {
DCHECK(is_swap_buffers_pending_);
is_swap_buffers_pending_ = false;
+ if (presented) {
+ // If we had not flipped, the two frame damage tracking is inconsistent.
+ // So conservatively take the whole frame.
+ if (!did_flip_)
+ previous_damage_rect_ = gfx::Rect(textures_[front()].size);
+ } else {
+ front_ = back();
+ previous_damage_rect_ = gfx::Rect(0, 0, 0, 0);
+ }
+
+ did_flip_ = presented;
+
// 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.
« no previous file with comments | « content/common/gpu/texture_image_transport_surface.h ('k') | ui/aura/bench/bench_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698