summaryrefslogtreecommitdiffstats
path: root/content/common
diff options
context:
space:
mode:
authormmocny@chromium.org <mmocny@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-24 01:19:50 +0000
committermmocny@chromium.org <mmocny@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-24 01:19:50 +0000
commitb145c17453d766ae5ab7eb92737321dd9f145d73 (patch)
treefe6297416386ec34e09a2f4738914859af9216f3 /content/common
parentae32c853fca54c520129e3296e9102eea1aa5d31 (diff)
downloadchromium_src-b145c17453d766ae5ab7eb92737321dd9f145d73.zip
chromium_src-b145c17453d766ae5ab7eb92737321dd9f145d73.tar.gz
chromium_src-b145c17453d766ae5ab7eb92737321dd9f145d73.tar.bz2
Reset previous damage rect when discarding frontbuffer, and make sure we draw a full frame before recreating it.
BUG=129188 TEST=Manual Review URL: https://chromiumcodereview.appspot.com/10409069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138688 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
-rw-r--r--content/common/gpu/image_transport_surface_linux.cc12
-rw-r--r--content/common/gpu/texture_image_transport_surface.cc12
2 files changed, 12 insertions, 12 deletions
diff --git a/content/common/gpu/image_transport_surface_linux.cc b/content/common/gpu/image_transport_surface_linux.cc
index 79c34af..0f9984f 100644
--- a/content/common/gpu/image_transport_surface_linux.cc
+++ b/content/common/gpu/image_transport_surface_linux.cc
@@ -399,10 +399,8 @@ void EGLImageTransportSurface::OnResize(gfx::Size size) {
bool EGLImageTransportSurface::SwapBuffers() {
DCHECK(backbuffer_suggested_allocation_);
- if (!frontbuffer_suggested_allocation_) {
- previous_damage_rect_ = gfx::Rect(visible_size_);
+ if (!frontbuffer_suggested_allocation_)
return true;
- }
front_surface_.swap(back_surface_);
DCHECK_NE(front_surface_.get(), static_cast<EGLAcceleratedSurface*>(NULL));
helper_->DeferToFence(base::Bind(
@@ -433,10 +431,12 @@ void EGLImageTransportSurface::SendBuffersSwapped() {
bool EGLImageTransportSurface::PostSubBuffer(
int x, int y, int width, int height) {
DCHECK(backbuffer_suggested_allocation_);
- if (!frontbuffer_suggested_allocation_) {
- previous_damage_rect_ = gfx::Rect(visible_size_);
+ if (!frontbuffer_suggested_allocation_)
return true;
- }
+ // If we are recreating the frontbuffer with this swap, make sure we are
+ // drawing a full frame.
+ DCHECK(front_surface_.get() ||
+ (!x && !y && gfx::Size(width, height) == visible_size_));
DCHECK_NE(back_surface_.get(), static_cast<EGLAcceleratedSurface*>(NULL));
gfx::Size expected_size = back_surface_->size();
bool surfaces_same_size = front_surface_.get() &&
diff --git a/content/common/gpu/texture_image_transport_surface.cc b/content/common/gpu/texture_image_transport_surface.cc
index 32f0810..7e22113 100644
--- a/content/common/gpu/texture_image_transport_surface.cc
+++ b/content/common/gpu/texture_image_transport_surface.cc
@@ -211,10 +211,8 @@ void TextureImageTransportSurface::OnWillDestroyStub(
bool TextureImageTransportSurface::SwapBuffers() {
DCHECK(backbuffer_suggested_allocation_);
- if (!frontbuffer_suggested_allocation_) {
- previous_damage_rect_ = gfx::Rect(textures_[front_].size);
+ if (!frontbuffer_suggested_allocation_)
return true;
- }
if (!parent_stub_) {
LOG(ERROR) << "SwapBuffers failed because no parent stub.";
return false;
@@ -236,10 +234,12 @@ bool TextureImageTransportSurface::SwapBuffers() {
bool TextureImageTransportSurface::PostSubBuffer(
int x, int y, int width, int height) {
DCHECK(backbuffer_suggested_allocation_);
- if (!frontbuffer_suggested_allocation_) {
- previous_damage_rect_ = gfx::Rect(textures_[front_].size);
+ if (!frontbuffer_suggested_allocation_)
return true;
- }
+ // If we are recreating the frontbuffer with this swap, make sure we are
+ // drawing a full frame.
+ DCHECK(textures_[front_].info->service_id() ||
+ (!x && !y && gfx::Size(width, height) == textures_[back()].size));
if (!parent_stub_) {
LOG(ERROR) << "PostSubBuffer failed because no parent stub.";
return false;