OLD | NEW |
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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include <android/bitmap.h> | 9 #include <android/bitmap.h> |
10 #include <android/native_window_jni.h> | 10 #include <android/native_window_jni.h> |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // Ensure the toolbar resource is available before making the layer visible. | 253 // Ensure the toolbar resource is available before making the layer visible. |
254 ui::ResourceManager::Resource* resource = | 254 ui::ResourceManager::Resource* resource = |
255 compositor_->GetResourceManager().GetResource( | 255 compositor_->GetResourceManager().GetResource( |
256 ui::ANDROID_RESOURCE_TYPE_DYNAMIC, toolbar_resource_id); | 256 ui::ANDROID_RESOURCE_TYPE_DYNAMIC, toolbar_resource_id); |
257 if (!resource) | 257 if (!resource) |
258 visible = false; | 258 visible = false; |
259 | 259 |
260 toolbar_layer_->layer()->SetHideLayerAndSubtree(!visible); | 260 toolbar_layer_->layer()->SetHideLayerAndSubtree(!visible); |
261 if (visible) { | 261 if (visible) { |
262 toolbar_layer_->layer()->SetPosition(gfx::PointF(0, top_offset)); | 262 toolbar_layer_->layer()->SetPosition(gfx::PointF(0, top_offset)); |
263 toolbar_layer_->PushResource(resource, false, false, false, brightness); | 263 toolbar_layer_->PushResource( |
| 264 resource, SK_ColorWHITE, false, false, brightness); |
264 | 265 |
265 // If we're at rest, hide the shadow. The Android view should be drawing. | 266 // If we're at rest, hide the shadow. The Android view should be drawing. |
266 toolbar_layer_->layer()->SetMasksToBounds(top_offset >= 0.f | 267 toolbar_layer_->layer()->SetMasksToBounds(top_offset >= 0.f |
267 && !show_shadow); | 268 && !show_shadow); |
268 } | 269 } |
269 } | 270 } |
270 | 271 |
271 void CompositorView::UpdateProgressBar(JNIEnv* env, | 272 void CompositorView::UpdateProgressBar(JNIEnv* env, |
272 jobject object, | 273 jobject object, |
273 jint progress_bar_x, | 274 jint progress_bar_x, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 // through here but through BrowserChildProcessHostDisconnected() instead. | 322 // through here but through BrowserChildProcessHostDisconnected() instead. |
322 } | 323 } |
323 | 324 |
324 // Register native methods | 325 // Register native methods |
325 bool RegisterCompositorView(JNIEnv* env) { | 326 bool RegisterCompositorView(JNIEnv* env) { |
326 return RegisterNativesImpl(env); | 327 return RegisterNativesImpl(env); |
327 } | 328 } |
328 | 329 |
329 } // namespace android | 330 } // namespace android |
330 } // namespace chrome | 331 } // namespace chrome |
OLD | NEW |