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

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

Issue 9564008: Aura: PostSubBuffer implementation for --ui-use-gpu-process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "" Created 8 years, 10 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/image_transport_surface_linux.cc
diff --git a/content/common/gpu/image_transport_surface_linux.cc b/content/common/gpu/image_transport_surface_linux.cc
index c73c071e90273f2b5e2b299974524c1dd56d7c8b..e41bfcf098a92a4d5559fdcf2ff06e4d94c7c665 100644
--- a/content/common/gpu/image_transport_surface_linux.cc
+++ b/content/common/gpu/image_transport_surface_linux.cc
@@ -109,8 +109,6 @@ class EGLImageTransportSurface
void ReleaseSurface(scoped_refptr<EGLAcceleratedSurface>* surface);
void SendBuffersSwapped();
void SendPostSubBuffer(int x, int y, int width, int height);
- void GetRegionsToCopy(const gfx::Rect& new_damage_rect,
- std::vector<gfx::Rect>* regions);
// Tracks the current surface visibility state.
VisibilityState visibility_state_;
@@ -436,7 +434,7 @@ bool EGLImageTransportSurface::PostSubBuffer(
const gfx::Rect new_damage_rect = gfx::Rect(x, y, width, height);
if (surfaces_same_size) {
std::vector<gfx::Rect> regions_to_copy;
- GetRegionsToCopy(new_damage_rect, &regions_to_copy);
+ GetRegionsToCopy(previous_damage_rect_, new_damage_rect, &regions_to_copy);
GLint previous_texture_id = 0;
glGetIntegerv(GL_ACTIVE_TEXTURE, &previous_texture_id);
@@ -487,42 +485,6 @@ void EGLImageTransportSurface::SendPostSubBuffer(
helper_->SetScheduled(false);
}
-void EGLImageTransportSurface::GetRegionsToCopy(
- const gfx::Rect& new_damage_rect,
- std::vector<gfx::Rect>* regions) {
- DCHECK(front_surface_->size() == back_surface_->size());
- gfx::Rect intersection = previous_damage_rect_.Intersect(new_damage_rect);
-
- if (intersection.IsEmpty()) {
- regions->push_back(previous_damage_rect_);
- return;
- }
-
- // Top (above the intersection).
- regions->push_back(gfx::Rect(previous_damage_rect_.x(),
- previous_damage_rect_.y(),
- previous_damage_rect_.width(),
- intersection.y() - previous_damage_rect_.y()));
-
- // Left (of the intersection).
- regions->push_back(gfx::Rect(previous_damage_rect_.x(),
- intersection.y(),
- intersection.x() - previous_damage_rect_.x(),
- intersection.height()));
-
- // Right (of the intersection).
- regions->push_back(gfx::Rect(intersection.right(),
- intersection.y(),
- previous_damage_rect_.right() - intersection.right(),
- intersection.height()));
-
- // Bottom (below the intersection).
- regions->push_back(gfx::Rect(previous_damage_rect_.x(),
- intersection.bottom(),
- previous_damage_rect_.width(),
- previous_damage_rect_.bottom() - intersection.bottom()));
-}
-
std::string EGLImageTransportSurface::GetExtensions() {
std::string extensions = gfx::GLSurface::GetExtensions();
extensions += extensions.empty() ? "" : " ";

Powered by Google App Engine
This is Rietveld 408576698