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

Unified Diff: content/browser/compositor/reflector_impl.cc

Issue 2392183003: cc: Remove SurfaceSize from OutputSurface. (Closed)
Patch Set: nosurfacesize: ozonethinger Created 4 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/browser/compositor/reflector_impl.h ('k') | content/browser/compositor/reflector_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/reflector_impl.cc
diff --git a/content/browser/compositor/reflector_impl.cc b/content/browser/compositor/reflector_impl.cc
index 2e4ae743842ae0a17e5bb6986a7ddd126610ec7f..ff672eaa1869b31a4c8ae73c74ad839630548e86 100644
--- a/content/browser/compositor/reflector_impl.cc
+++ b/content/browser/compositor/reflector_impl.cc
@@ -107,38 +107,36 @@ void ReflectorImpl::OnSourceTextureMailboxUpdated(
}
}
-void ReflectorImpl::OnSourceSwapBuffers() {
+void ReflectorImpl::OnSourceSwapBuffers(const gfx::Size& surface_size) {
if (mirroring_layers_.empty())
return;
// Should be attached to the source output surface already.
DCHECK(mailbox_.get());
- gfx::Size size = output_surface_->SurfaceSize();
-
// Request full redraw on mirroring compositor.
for (LayerData* layer_data : mirroring_layers_)
- UpdateTexture(layer_data, size, layer_data->layer->bounds());
+ UpdateTexture(layer_data, surface_size, layer_data->layer->bounds());
}
-void ReflectorImpl::OnSourcePostSubBuffer(const gfx::Rect& rect) {
+void ReflectorImpl::OnSourcePostSubBuffer(const gfx::Rect& swap_rect,
+ const gfx::Size& surface_size) {
if (mirroring_layers_.empty())
return;
// Should be attached to the source output surface already.
DCHECK(mailbox_.get());
- gfx::Size size = output_surface_->SurfaceSize();
-
- int y = rect.y();
- // Flip the coordinates to compositor's one.
- if (flip_texture_)
- y = size.height() - rect.y() - rect.height();
- gfx::Rect mirroring_rect(rect.x(), y, rect.width(), rect.height());
+ gfx::Rect mirroring_rect = swap_rect;
+ if (flip_texture_) {
+ // Flip the coordinates to compositor's one.
+ mirroring_rect.set_y(surface_size.height() - swap_rect.y() -
+ swap_rect.height());
+ }
// Request redraw of the dirty portion in mirroring compositor.
for (LayerData* layer_data : mirroring_layers_)
- UpdateTexture(layer_data, size, mirroring_rect);
+ UpdateTexture(layer_data, surface_size, mirroring_rect);
}
static void ReleaseMailbox(scoped_refptr<OwnedMailbox> mailbox,
« no previous file with comments | « content/browser/compositor/reflector_impl.h ('k') | content/browser/compositor/reflector_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698