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 package org.chromium.chrome.browser.compositor.scene_layer; | 5 package org.chromium.chrome.browser.compositor.scene_layer; |
6 | 6 |
7 import org.chromium.base.annotations.JNINamespace; | 7 import org.chromium.base.annotations.JNINamespace; |
8 import org.chromium.chrome.browser.compositor.LayerTitleCache; | 8 import org.chromium.chrome.browser.compositor.LayerTitleCache; |
9 import org.chromium.chrome.browser.compositor.layouts.components.LayoutTab; | 9 import org.chromium.chrome.browser.compositor.layouts.components.LayoutTab; |
10 import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; | 10 import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 return; | 42 return; |
43 } | 43 } |
44 | 44 |
45 float contentOffset = | 45 float contentOffset = |
46 fullscreenManager != null ? fullscreenManager.getContentOffset()
: 0.f; | 46 fullscreenManager != null ? fullscreenManager.getContentOffset()
: 0.f; |
47 float x = layoutTab.getRenderX() * dpToPx; | 47 float x = layoutTab.getRenderX() * dpToPx; |
48 float y = contentOffset + layoutTab.getRenderY() * dpToPx; | 48 float y = contentOffset + layoutTab.getRenderY() * dpToPx; |
49 | 49 |
50 nativeUpdateTabLayer(mNativePtr, tabContentManager, layoutTab.getId(), | 50 nativeUpdateTabLayer(mNativePtr, tabContentManager, layoutTab.getId(), |
51 mResToolbarControlContainer, layoutTab.canUseLiveTexture(), | 51 mResToolbarControlContainer, layoutTab.canUseLiveTexture(), |
52 layoutTab.getBackgroundColor(), x, y, layoutTab.getStaticToViewB
lend(), | 52 layoutTab.canUseStaticLayer(), layoutTab.getBackgroundColor(), x
, y, |
53 layoutTab.getSaturation(), layoutTab.getBrightness()); | 53 layoutTab.getStaticToViewBlend(), layoutTab.getSaturation(), |
| 54 layoutTab.getBrightness()); |
54 } | 55 } |
55 | 56 |
56 @Override | 57 @Override |
57 protected void initializeNative() { | 58 protected void initializeNative() { |
58 if (mNativePtr == 0) { | 59 if (mNativePtr == 0) { |
59 mNativePtr = nativeInit(); | 60 mNativePtr = nativeInit(); |
60 } | 61 } |
61 assert mNativePtr != 0; | 62 assert mNativePtr != 0; |
62 } | 63 } |
63 | 64 |
64 @Override | 65 @Override |
65 public void destroy() { | 66 public void destroy() { |
66 super.destroy(); | 67 super.destroy(); |
67 mNativePtr = 0; | 68 mNativePtr = 0; |
68 } | 69 } |
69 | 70 |
70 private native long nativeInit(); | 71 private native long nativeInit(); |
71 private native void nativeUpdateTabLayer(long nativeStaticTabSceneLayer, | 72 private native void nativeUpdateTabLayer(long nativeStaticTabSceneLayer, |
72 TabContentManager tabContentManager, int id, int toolbarResourceId, | 73 TabContentManager tabContentManager, int id, int toolbarResourceId, |
73 boolean canUseLiveLayer, int backgroundColor, float x, float y, floa
t staticToViewBlend, | 74 boolean canUseLiveLayer, boolean canUseStaticLayer, int backgroundCo
lor, float x, |
74 float saturation, float brightness); | 75 float y, float staticToViewBlend, float saturation, float brightness
); |
75 } | 76 } |
OLD | NEW |