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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 main_message_loop_->PostTask( | 61 main_message_loop_->PostTask( |
62 FROM_HERE, | 62 FROM_HERE, |
63 base::Bind(&ReflectorImpl::DeleteOnMainThread, | 63 base::Bind(&ReflectorImpl::DeleteOnMainThread, |
64 scoped_refptr<ReflectorImpl>(this))); | 64 scoped_refptr<ReflectorImpl>(this))); |
65 } | 65 } |
66 | 66 |
67 // This must be called on ImplThread, or before the surface is passed to | 67 // This must be called on ImplThread, or before the surface is passed to |
68 // ImplThread. | 68 // ImplThread. |
69 void ReflectorImpl::AttachToOutputSurface( | 69 void ReflectorImpl::AttachToOutputSurface( |
70 BrowserCompositorOutputSurface* output_surface) { | 70 BrowserCompositorOutputSurface* output_surface) { |
71 gl_helper_.reset(new GLHelper(output_surface->context3d())); | 71 gl_helper_.reset( |
| 72 new GLHelper(output_surface->context_provider()->Context3d())); |
72 output_surface->SetReflector(this); | 73 output_surface->SetReflector(this); |
73 } | 74 } |
74 | 75 |
75 void ReflectorImpl::OnMirroringCompositorResized() { | 76 void ReflectorImpl::OnMirroringCompositorResized() { |
76 mirroring_compositor_->ScheduleFullRedraw(); | 77 mirroring_compositor_->ScheduleFullRedraw(); |
77 } | 78 } |
78 | 79 |
79 void ReflectorImpl::OnLostResources() { | 80 void ReflectorImpl::OnLostResources() { |
80 shared_texture_ = NULL; | 81 shared_texture_ = NULL; |
81 mirroring_layer_->SetExternalTexture(NULL); | 82 mirroring_layer_->SetExternalTexture(NULL); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 int y = size.height() - rect.y() - rect.height(); | 153 int y = size.height() - rect.y() - rect.height(); |
153 gfx::Rect new_rect(rect.x(), y, rect.width(), rect.height()); | 154 gfx::Rect new_rect(rect.x(), y, rect.width(), rect.height()); |
154 mirroring_layer_->SchedulePaint(new_rect); | 155 mirroring_layer_->SchedulePaint(new_rect); |
155 } | 156 } |
156 | 157 |
157 void ReflectorImpl::FullRedrawContentOnMainThread() { | 158 void ReflectorImpl::FullRedrawContentOnMainThread() { |
158 mirrored_compositor_->ScheduleFullRedraw(); | 159 mirrored_compositor_->ScheduleFullRedraw(); |
159 } | 160 } |
160 | 161 |
161 } // namespace content | 162 } // namespace content |
OLD | NEW |