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

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

Issue 867483003: Revert of compositor: Fix texture flipping for SW mirroring with surfaceless (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 c2d19b136f07f14b9117810858f2cdae70873108..ac3bdda748e0d8c56bf346ddb3f4a73ec643f08d 100644
--- a/content/browser/compositor/reflector_impl.cc
+++ b/content/browser/compositor/reflector_impl.cc
@@ -38,9 +38,7 @@
ui::Layer* mirroring_layer)
: needs_set_mailbox(true),
mirrored_compositor(mirrored_compositor),
- mirroring_layer(mirroring_layer),
- flip_texture(false) {
-}
+ mirroring_layer(mirroring_layer) {}
ReflectorImpl::MainThreadData::~MainThreadData() {}
@@ -195,10 +193,10 @@
impl.gl_helper->Flush();
output_surface->SetReflector(this);
// The texture doesn't have the data, so invokes full redraw now.
- bool flip_texture = !output_surface->capabilities().flipped_output_surface;
main_message_loop_->PostTask(
- FROM_HERE, base::Bind(&ReflectorImpl::FullRedrawContentOnMainThread,
- scoped_refptr<ReflectorImpl>(this), flip_texture));
+ FROM_HERE,
+ base::Bind(&ReflectorImpl::FullRedrawContentOnMainThread,
+ scoped_refptr<ReflectorImpl>(this)));
}
void ReflectorImpl::UpdateTextureSizeOnMainThread(gfx::Size size) {
@@ -217,7 +215,6 @@
main.mirroring_layer->SetTextureSize(size);
}
main.mirroring_layer->SetBounds(gfx::Rect(size));
- main.mirroring_layer->SetTextureFlipped(main.flip_texture);
}
void ReflectorImpl::FullRedrawOnMainThread(gfx::Size size) {
@@ -228,24 +225,20 @@
main.mirroring_layer->SchedulePaint(main.mirroring_layer->bounds());
}
-void ReflectorImpl::UpdateSubBufferOnMainThread(const gfx::Size& size,
- const gfx::Rect& rect) {
+void ReflectorImpl::UpdateSubBufferOnMainThread(gfx::Size size,
+ gfx::Rect rect) {
MainThreadData& main = GetMain();
if (!main.mirroring_layer)
return;
UpdateTextureSizeOnMainThread(size);
-
- int y = rect.y();
// Flip the coordinates to compositor's one.
- if (main.flip_texture)
- y = size.height() - rect.y() - rect.height();
+ int y = size.height() - rect.y() - rect.height();
gfx::Rect new_rect(rect.x(), y, rect.width(), rect.height());
main.mirroring_layer->SchedulePaint(new_rect);
}
-void ReflectorImpl::FullRedrawContentOnMainThread(bool flip_texture) {
- MainThreadData& main = GetMain();
- main.flip_texture = flip_texture;
+void ReflectorImpl::FullRedrawContentOnMainThread() {
+ MainThreadData& main = GetMain();
main.mirrored_compositor->ScheduleFullRedraw();
}
« 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