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

Side by Side Diff: remoting/client/desktop_viewport.cc

Issue 2874143002: [CRD iOS] Some fixes for rendering (Closed)
Patch Set: Just use presentRenderbuffer to swap buffers Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | remoting/client/display/canvas.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/desktop_viewport.h" 5 #include "remoting/client/desktop_viewport.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
11 namespace remoting { 11 namespace remoting {
12 12
13 namespace { 13 namespace {
14 14
15 float MAX_ZOOM_LEVEL = 100.f; 15 float MAX_ZOOM_LEVEL = 100.f;
16 16
17 } // namespace 17 } // namespace
18 18
19 DesktopViewport::DesktopViewport() : desktop_to_surface_transform_() {} 19 DesktopViewport::DesktopViewport() : desktop_to_surface_transform_() {}
20 20
21 DesktopViewport::~DesktopViewport() {} 21 DesktopViewport::~DesktopViewport() {}
22 22
23 void DesktopViewport::SetDesktopSize(int desktop_width, int desktop_height) { 23 void DesktopViewport::SetDesktopSize(int desktop_width, int desktop_height) {
24 if (desktop_width == desktop_size_.x && desktop_height == desktop_size_.y) {
25 return;
26 }
27
24 desktop_size_.x = desktop_width; 28 desktop_size_.x = desktop_width;
25 desktop_size_.y = desktop_height; 29 desktop_size_.y = desktop_height;
26 ResizeToFit(); 30 ResizeToFit();
27 } 31 }
28 32
29 void DesktopViewport::SetSurfaceSize(int surface_width, int surface_height) { 33 void DesktopViewport::SetSurfaceSize(int surface_width, int surface_height) {
34 if (surface_width == surface_size_.x && surface_height == surface_size_.y) {
35 return;
36 }
37
30 surface_size_.x = surface_width; 38 surface_size_.x = surface_width;
31 surface_size_.y = surface_height; 39 surface_size_.y = surface_height;
32 ResizeToFit(); 40 ResizeToFit();
33 } 41 }
34 42
35 void DesktopViewport::MoveDesktop(float dx, float dy) { 43 void DesktopViewport::MoveDesktop(float dx, float dy) {
36 desktop_to_surface_transform_.PostTranslate({dx, dy}); 44 desktop_to_surface_transform_.PostTranslate({dx, dy});
37 UpdateViewport(); 45 UpdateViewport();
38 } 46 }
39 47
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 237
230 if (new_point.y < bounds.top) { 238 if (new_point.y < bounds.top) {
231 new_point.y = bounds.top; 239 new_point.y = bounds.top;
232 } else if (new_point.y > bounds.bottom) { 240 } else if (new_point.y > bounds.bottom) {
233 new_point.y = bounds.bottom; 241 new_point.y = bounds.bottom;
234 } 242 }
235 return new_point; 243 return new_point;
236 } 244 }
237 245
238 } // namespace remoting 246 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/client/display/canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698