| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "remoting/client/display/gl_desktop.h" | 5 #include "remoting/client/display/gl_desktop.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "remoting/client/display/canvas.h" | 9 #include "remoting/client/display/canvas.h" |
| 10 #include "remoting/client/display/gl_math.h" | 10 #include "remoting/client/display/gl_math.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 } // namespace | 53 } // namespace |
| 54 | 54 |
| 55 struct GlDesktop::GlDesktopTextureContainer { | 55 struct GlDesktop::GlDesktopTextureContainer { |
| 56 std::unique_ptr<GlRenderLayer> layer; | 56 std::unique_ptr<GlRenderLayer> layer; |
| 57 webrtc::DesktopRect rect; | 57 webrtc::DesktopRect rect; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 GlDesktop::GlDesktop() : weak_factory_(this) {} | 60 GlDesktop::GlDesktop() : weak_factory_(this) {} |
| 61 | 61 |
| 62 GlDesktop::~GlDesktop() {} | 62 GlDesktop::~GlDesktop() { |
| 63 DCHECK(thread_checker_.CalledOnValidThread()); |
| 64 } |
| 63 | 65 |
| 64 void GlDesktop::SetCanvas(base::WeakPtr<Canvas> canvas) { | 66 void GlDesktop::SetCanvas(base::WeakPtr<Canvas> canvas) { |
| 65 last_desktop_size_.set(0, 0); | 67 last_desktop_size_.set(0, 0); |
| 66 textures_.clear(); | 68 textures_.clear(); |
| 67 canvas_ = canvas; | 69 canvas_ = canvas; |
| 68 if (canvas) { | 70 if (canvas) { |
| 69 max_texture_size_ = canvas->GetMaxTextureSize(); | 71 max_texture_size_ = canvas->GetMaxTextureSize(); |
| 70 } | 72 } |
| 71 } | 73 } |
| 72 | 74 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 } | 132 } |
| 131 } | 133 } |
| 132 } | 134 } |
| 133 | 135 |
| 134 base::WeakPtr<Drawable> GlDesktop::GetWeakPtr() { | 136 base::WeakPtr<Drawable> GlDesktop::GetWeakPtr() { |
| 135 DCHECK(thread_checker_.CalledOnValidThread()); | 137 DCHECK(thread_checker_.CalledOnValidThread()); |
| 136 return weak_factory_.GetWeakPtr(); | 138 return weak_factory_.GetWeakPtr(); |
| 137 } | 139 } |
| 138 | 140 |
| 139 } // namespace remoting | 141 } // namespace remoting |
| OLD | NEW |