| OLD | NEW | 
|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "content/browser/compositor/reflector_impl.h" | 5 #include "content/browser/compositor/reflector_impl.h" | 
| 6 | 6 | 
| 7 #include "base/bind.h" | 7 #include "base/bind.h" | 
| 8 #include "base/location.h" | 8 #include "base/location.h" | 
| 9 #include "content/browser/compositor/browser_compositor_output_surface.h" | 9 #include "content/browser/compositor/browser_compositor_output_surface.h" | 
| 10 #include "content/browser/compositor/owned_mailbox.h" | 10 #include "content/browser/compositor/owned_mailbox.h" | 
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 194   output_surface->SetReflector(this); | 194   output_surface->SetReflector(this); | 
| 195   // The texture doesn't have the data, so invokes full redraw now. | 195   // The texture doesn't have the data, so invokes full redraw now. | 
| 196   main_message_loop_->PostTask( | 196   main_message_loop_->PostTask( | 
| 197       FROM_HERE, | 197       FROM_HERE, | 
| 198       base::Bind(&ReflectorImpl::FullRedrawContentOnMainThread, | 198       base::Bind(&ReflectorImpl::FullRedrawContentOnMainThread, | 
| 199                  scoped_refptr<ReflectorImpl>(this))); | 199                  scoped_refptr<ReflectorImpl>(this))); | 
| 200 } | 200 } | 
| 201 | 201 | 
| 202 void ReflectorImpl::UpdateTextureSizeOnMainThread(gfx::Size size) { | 202 void ReflectorImpl::UpdateTextureSizeOnMainThread(gfx::Size size) { | 
| 203   MainThreadData& main = GetMain(); | 203   MainThreadData& main = GetMain(); | 
| 204   if (!main.mirroring_layer || !main.mailbox || | 204   if (!main.mirroring_layer || !main.mailbox.get() || | 
| 205       main.mailbox->mailbox().IsZero()) | 205       main.mailbox->mailbox().IsZero()) | 
| 206     return; | 206     return; | 
| 207   if (main.needs_set_mailbox) { | 207   if (main.needs_set_mailbox) { | 
| 208     main.mirroring_layer->SetTextureMailbox( | 208     main.mirroring_layer->SetTextureMailbox( | 
| 209         cc::TextureMailbox(main.mailbox->holder()), | 209         cc::TextureMailbox(main.mailbox->holder()), | 
| 210         cc::SingleReleaseCallback::Create( | 210         cc::SingleReleaseCallback::Create( | 
| 211             base::Bind(ReleaseMailbox, main.mailbox)), | 211             base::Bind(ReleaseMailbox, main.mailbox)), | 
| 212         size); | 212         size); | 
| 213     main.needs_set_mailbox = false; | 213     main.needs_set_mailbox = false; | 
| 214   } else { | 214   } else { | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
| 236   gfx::Rect new_rect(rect.x(), y, rect.width(), rect.height()); | 236   gfx::Rect new_rect(rect.x(), y, rect.width(), rect.height()); | 
| 237   main.mirroring_layer->SchedulePaint(new_rect); | 237   main.mirroring_layer->SchedulePaint(new_rect); | 
| 238 } | 238 } | 
| 239 | 239 | 
| 240 void ReflectorImpl::FullRedrawContentOnMainThread() { | 240 void ReflectorImpl::FullRedrawContentOnMainThread() { | 
| 241   MainThreadData& main = GetMain(); | 241   MainThreadData& main = GetMain(); | 
| 242   main.mirrored_compositor->ScheduleFullRedraw(); | 242   main.mirrored_compositor->ScheduleFullRedraw(); | 
| 243 } | 243 } | 
| 244 | 244 | 
| 245 }  // namespace content | 245 }  // namespace content | 
| OLD | NEW | 
|---|