| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/aura/reflector_impl.h" | 5 #include "content/browser/aura/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/aura/browser_compositor_output_surface.h" | 9 #include "content/browser/aura/browser_compositor_output_surface.h" |
| 10 #include "content/common/gpu/client/gl_helper.h" | 10 #include "content/common/gpu/client/gl_helper.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 new GLHelper(output_surface->context_provider()->Context3d())); | 91 new GLHelper(output_surface->context_provider()->Context3d())); |
| 92 output_surface->SetReflector(this); | 92 output_surface->SetReflector(this); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void ReflectorImpl::OnMirroringCompositorResized() { | 95 void ReflectorImpl::OnMirroringCompositorResized() { |
| 96 mirroring_compositor_->ScheduleFullRedraw(); | 96 mirroring_compositor_->ScheduleFullRedraw(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void ReflectorImpl::OnLostResources() { | 99 void ReflectorImpl::OnLostResources() { |
| 100 shared_texture_ = NULL; | 100 shared_texture_ = NULL; |
| 101 mirroring_layer_->SetExternalTexture(NULL); | 101 mirroring_layer_->SetShowPaintedContent(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void ReflectorImpl::OnReshape(gfx::Size size) { | 104 void ReflectorImpl::OnReshape(gfx::Size size) { |
| 105 if (texture_size_ == size) | 105 if (texture_size_ == size) |
| 106 return; | 106 return; |
| 107 texture_size_ = size; | 107 texture_size_ = size; |
| 108 DCHECK(texture_id_); | 108 DCHECK(texture_id_); |
| 109 gl_helper_->ResizeTexture(texture_id_, size); | 109 gl_helper_->ResizeTexture(texture_id_, size); |
| 110 main_message_loop_->PostTask( | 110 main_message_loop_->PostTask( |
| 111 FROM_HERE, | 111 FROM_HERE, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 int y = size.height() - rect.y() - rect.height(); | 172 int y = size.height() - rect.y() - rect.height(); |
| 173 gfx::Rect new_rect(rect.x(), y, rect.width(), rect.height()); | 173 gfx::Rect new_rect(rect.x(), y, rect.width(), rect.height()); |
| 174 mirroring_layer_->SchedulePaint(new_rect); | 174 mirroring_layer_->SchedulePaint(new_rect); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void ReflectorImpl::FullRedrawContentOnMainThread() { | 177 void ReflectorImpl::FullRedrawContentOnMainThread() { |
| 178 mirrored_compositor_->ScheduleFullRedraw(); | 178 mirrored_compositor_->ScheduleFullRedraw(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace content | 181 } // namespace content |
| OLD | NEW |