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

Unified Diff: content/common/gpu/image_transport_surface.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.cc
diff --git a/content/common/gpu/image_transport_surface.cc b/content/common/gpu/image_transport_surface.cc
index 2f12e7bb444705e2b25bcf0692c82d9da6c6c1e5..3160abb7fb4fc804bb76f0b65272c95f79b0034c 100644
--- a/content/common/gpu/image_transport_surface.cc
+++ b/content/common/gpu/image_transport_surface.cc
@@ -22,6 +22,42 @@ ImageTransportSurface::ImageTransportSurface() {
ImageTransportSurface::~ImageTransportSurface() {
}
+void ImageTransportSurface::GetRegionsToCopy(
+ const gfx::Rect& previous_damage_rect,
+ const gfx::Rect& new_damage_rect,
+ std::vector<gfx::Rect>* regions) {
+ 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()));
+}
+
ImageTransportHelper::ImageTransportHelper(ImageTransportSurface* surface,
GpuChannelManager* manager,
GpuCommandBufferStub* stub,

Powered by Google App Engine
This is Rietveld 408576698