| 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 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_H_ | 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/android/jni_weak_ref.h" | 12 #include "base/android/jni_weak_ref.h" |
| 13 #include "base/android/scoped_java_ref.h" | 13 #include "base/android/scoped_java_ref.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "chrome/browser/android/compositor/scene_layer/scene_layer.h" | 16 #include "chrome/browser/android/compositor/scene_layer/scene_layer.h" |
| 17 #include "ui/gfx/geometry/point.h" | 17 #include "ui/gfx/geometry/point.h" |
| 18 #include "ui/gfx/geometry/point_f.h" | 18 #include "ui/gfx/geometry/point_f.h" |
| 19 #include "ui/gfx/geometry/size.h" | 19 #include "ui/gfx/geometry/size.h" |
| 20 #include "ui/gfx/geometry/size_f.h" | 20 #include "ui/gfx/geometry/size_f.h" |
| 21 | 21 |
| 22 namespace cc { | 22 namespace cc { |
| 23 class Layer; | 23 class Layer; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace chrome { | 26 namespace chrome { |
| 27 namespace android { | 27 namespace android { |
| 28 | 28 |
| 29 class ContentLayer; | 29 class ContentLayer; |
| 30 class ToolbarLayer; |
| 30 | 31 |
| 31 // A SceneLayer to render a static tab. | 32 // A SceneLayer to render a static tab. |
| 32 class StaticTabSceneLayer : public SceneLayer { | 33 class StaticTabSceneLayer : public SceneLayer { |
| 33 public: | 34 public: |
| 34 StaticTabSceneLayer(JNIEnv* env, jobject jobj); | 35 StaticTabSceneLayer(JNIEnv* env, jobject jobj); |
| 35 ~StaticTabSceneLayer() override; | 36 ~StaticTabSceneLayer() override; |
| 36 | 37 |
| 37 bool ShouldShowBackground() override; | 38 bool ShouldShowBackground() override; |
| 38 SkColor GetBackgroundColor() override; | 39 SkColor GetBackgroundColor() override; |
| 39 | 40 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 51 jboolean can_use_live_layer, | 52 jboolean can_use_live_layer, |
| 52 jint default_background_color, | 53 jint default_background_color, |
| 53 jfloat x, | 54 jfloat x, |
| 54 jfloat y, | 55 jfloat y, |
| 55 jfloat width, | 56 jfloat width, |
| 56 jfloat height, | 57 jfloat height, |
| 57 jfloat content_offset_y, | 58 jfloat content_offset_y, |
| 58 jfloat static_to_view_blend, | 59 jfloat static_to_view_blend, |
| 59 jfloat saturation, | 60 jfloat saturation, |
| 60 jfloat brightness); | 61 jfloat brightness); |
| 61 | 62 // Update the compositor version of the toolbar. |
| 62 // Set the given |jscene_layer| as content of this SceneLayer, along with its | 63 void UpdateToolbarLayer( |
| 63 // own content. | |
| 64 void SetContentSceneLayer( | |
| 65 JNIEnv* env, | 64 JNIEnv* env, |
| 66 const base::android::JavaParamRef<jobject>& jobj, | 65 const base::android::JavaParamRef<jobject>& object, |
| 67 const base::android::JavaParamRef<jobject>& jscene_layer); | 66 const base::android::JavaParamRef<jobject>& jresource_manager, |
| 67 jint toolbar_resource_id, |
| 68 jint toolbar_background_color, |
| 69 jint url_bar_resource_id, |
| 70 jfloat url_bar_alpha, |
| 71 jfloat top_offset, |
| 72 bool visible, |
| 73 bool show_shadow); |
| 74 // Update the progress bar. |
| 75 void UpdateProgressBar( |
| 76 JNIEnv* env, |
| 77 const base::android::JavaParamRef<jobject>& object, |
| 78 jint progress_bar_x, |
| 79 jint progress_bar_y, |
| 80 jint progress_bar_width, |
| 81 jint progress_bar_height, |
| 82 jint progress_bar_color, |
| 83 jint progress_bar_background_x, |
| 84 jint progress_bar_background_y, |
| 85 jint progress_bar_background_width, |
| 86 jint progress_bar_background_height, |
| 87 jint progress_bar_background_color); |
| 68 | 88 |
| 69 private: | 89 private: |
| 70 scoped_refptr<chrome::android::ContentLayer> content_layer_; | 90 scoped_refptr<chrome::android::ContentLayer> content_layer_; |
| 71 scoped_refptr<cc::Layer> content_scene_layer_; | 91 scoped_refptr<cc::Layer> content_scene_layer_; |
| 92 scoped_refptr<ToolbarLayer> toolbar_layer_; |
| 72 | 93 |
| 73 int last_set_tab_id_; | 94 int last_set_tab_id_; |
| 74 int background_color_; | 95 int background_color_; |
| 75 float brightness_; | 96 float brightness_; |
| 76 | 97 |
| 77 DISALLOW_COPY_AND_ASSIGN(StaticTabSceneLayer); | 98 DISALLOW_COPY_AND_ASSIGN(StaticTabSceneLayer); |
| 78 }; | 99 }; |
| 79 | 100 |
| 80 bool RegisterStaticTabSceneLayer(JNIEnv* env); | 101 bool RegisterStaticTabSceneLayer(JNIEnv* env); |
| 81 | 102 |
| 82 } // namespace android | 103 } // namespace android |
| 83 } // namespace chrome | 104 } // namespace chrome |
| 84 | 105 |
| 85 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_
H_ | 106 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_
H_ |
| OLD | NEW |