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

Side by Side Diff: chrome/browser/android/compositor/compositor_view.cc

Issue 2482233002: Remove visible viewport dependency in CompositorView (Closed)
Patch Set: address comments Created 4 years, 1 month 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 | « chrome/browser/android/compositor/compositor_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/android/compositor/compositor_view.h" 5 #include "chrome/browser/android/compositor/compositor_view.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 #include <android/native_window_jni.h> 8 #include <android/native_window_jni.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 current_surface_format_ = format; 155 current_surface_format_ = format;
156 compositor_->SetSurface(surface); 156 compositor_->SetSurface(surface);
157 } 157 }
158 gfx::Size size = gfx::Size(width, height); 158 gfx::Size size = gfx::Size(width, height);
159 compositor_->SetWindowBounds(size); 159 compositor_->SetWindowBounds(size);
160 content_width_ = size.width(); 160 content_width_ = size.width();
161 content_height_ = size.height(); 161 content_height_ = size.height();
162 root_layer_->SetBounds(gfx::Size(content_width_, content_height_)); 162 root_layer_->SetBounds(gfx::Size(content_width_, content_height_));
163 } 163 }
164 164
165 void CompositorView::SetLayoutViewport(JNIEnv* env, 165 void CompositorView::SetLayoutBounds(JNIEnv* env,
166 const JavaParamRef<jobject>& object, 166 const JavaParamRef<jobject>& object) {
167 jfloat x, 167 compositor_->setDeviceScaleFactor(1.0f);
aelias_OOO_until_Jul13 2016/11/09 00:20:20 Delete this line since it no longer belongs here,
mdjones 2016/11/09 01:36:32 Done.
168 jfloat y,
169 jfloat width,
170 jfloat height,
171 jfloat visible_x_offset,
172 jfloat visible_y_offset,
173 jfloat dp_to_pixel) {
174 compositor_->setDeviceScaleFactor(dp_to_pixel);
175 root_layer_->SetBounds(gfx::Size(content_width_, content_height_)); 168 root_layer_->SetBounds(gfx::Size(content_width_, content_height_));
176 } 169 }
177 170
178 void CompositorView::SetBackground(bool visible, SkColor color) { 171 void CompositorView::SetBackground(bool visible, SkColor color) {
179 if (overlay_video_mode_) 172 if (overlay_video_mode_)
180 visible = false; 173 visible = false;
181 root_layer_->SetBackgroundColor(color); 174 root_layer_->SetBackgroundColor(color);
182 root_layer_->SetIsDrawable(visible); 175 root_layer_->SetIsDrawable(visible);
183 } 176 }
184 177
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // The Android TERMINATION_STATUS_OOM_PROTECTED hack causes us to never go 254 // The Android TERMINATION_STATUS_OOM_PROTECTED hack causes us to never go
262 // through here but through BrowserChildProcessHostDisconnected() instead. 255 // through here but through BrowserChildProcessHostDisconnected() instead.
263 } 256 }
264 257
265 // Register native methods 258 // Register native methods
266 bool RegisterCompositorView(JNIEnv* env) { 259 bool RegisterCompositorView(JNIEnv* env) {
267 return RegisterNativesImpl(env); 260 return RegisterNativesImpl(env);
268 } 261 }
269 262
270 } // namespace android 263 } // namespace android
OLDNEW
« no previous file with comments | « chrome/browser/android/compositor/compositor_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698