Chromium Code Reviews| 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 BLIMP_CLIENT_APP_ANDROID_BLIMP_COMPOSITOR_MANAGER_ANDROID_H_ | 5 #ifndef BLIMP_CLIENT_APP_ANDROID_BLIMP_COMPOSITOR_MANAGER_ANDROID_H_ |
| 6 #define BLIMP_CLIENT_APP_ANDROID_BLIMP_COMPOSITOR_MANAGER_ANDROID_H_ | 6 #define BLIMP_CLIENT_APP_ANDROID_BLIMP_COMPOSITOR_MANAGER_ANDROID_H_ |
| 7 | 7 |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "blimp/client/app/android/blimp_view.h" | |
| 10 #include "blimp/client/feature/compositor/blimp_compositor_manager.h" | 11 #include "blimp/client/feature/compositor/blimp_compositor_manager.h" |
| 11 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
| 13 | 14 |
| 14 namespace base { | 15 namespace base { |
| 15 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
| 16 class Thread; | 17 class Thread; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace cc { | 20 namespace cc { |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 32 // |real_size| is the total display area including system decorations (see | 33 // |real_size| is the total display area including system decorations (see |
| 33 // android.view.Display.getRealSize()). |size| is the total display | 34 // android.view.Display.getRealSize()). |size| is the total display |
| 34 // area not including system decorations (see android.view.Display.getSize()). | 35 // area not including system decorations (see android.view.Display.getSize()). |
| 35 static std::unique_ptr<BlimpCompositorManagerAndroid> Create( | 36 static std::unique_ptr<BlimpCompositorManagerAndroid> Create( |
| 36 const gfx::Size& real_size, | 37 const gfx::Size& real_size, |
| 37 const gfx::Size& size, | 38 const gfx::Size& size, |
| 38 RenderWidgetFeature* render_widget_feature); | 39 RenderWidgetFeature* render_widget_feature); |
| 39 | 40 |
| 40 ~BlimpCompositorManagerAndroid() override; | 41 ~BlimpCompositorManagerAndroid() override; |
| 41 | 42 |
| 43 void SetBlimpView(BlimpView* view) { blimp_view_ = view; } | |
| 44 | |
| 42 protected: | 45 protected: |
| 43 // |size| is the size of the display. |real_size_supported| determines | 46 // |size| is the size of the display. |real_size_supported| determines |
| 44 // whether or not this size is the real display size or the display size | 47 // whether or not this size is the real display size or the display size |
| 45 // not including the system decorations. |dp_to_px| is the scale factor that | 48 // not including the system decorations. |dp_to_px| is the scale factor that |
| 46 // is required to convert from dp (device pixels) to px. | 49 // is required to convert from dp (device pixels) to px. |
| 47 BlimpCompositorManagerAndroid(const gfx::Size& size, | 50 BlimpCompositorManagerAndroid(const gfx::Size& size, |
| 48 bool real_size_supported, | 51 bool real_size_supported, |
| 49 RenderWidgetFeature* render_widget_feature); | 52 RenderWidgetFeature* render_widget_feature); |
| 50 | 53 |
| 51 // BlimpCompositor implementation. | 54 // BlimpCompositor implementation. |
| 52 void GenerateLayerTreeSettings(cc::LayerTreeSettings* settings) override; | 55 void GenerateLayerTreeSettings(cc::LayerTreeSettings* settings) override; |
| 53 | 56 |
| 54 private: | 57 private: |
| 58 void DidCompleteSwapBuffers() override; | |
| 59 | |
| 55 // Used to determine tile size for the compositor's rastered tiles. For a | 60 // Used to determine tile size for the compositor's rastered tiles. For a |
| 56 // device of width X height |portrait_width_| will be min(width, height) and | 61 // device of width X height |portrait_width_| will be min(width, height) and |
| 57 // |landscape_width_| will be max(width, height). | 62 // |landscape_width_| will be max(width, height). |
| 58 int portrait_width_; | 63 int portrait_width_; |
| 59 int landscape_width_; | 64 int landscape_width_; |
| 60 | 65 |
| 61 // True if the |portrait_width_| and |landscape_width_| represent the device's | 66 // True if the |portrait_width_| and |landscape_width_| represent the device's |
| 62 // physical dimensions, including any area occupied by system decorations. | 67 // physical dimensions, including any area occupied by system decorations. |
| 63 bool real_size_supported_; | 68 bool real_size_supported_; |
| 64 | 69 |
| 70 // Used to notify the BlimpView when compositor starts drawing to the screen. | |
| 71 BlimpView* blimp_view_; | |
|
Khushal
2016/04/28 03:32:26
I would suggest informing the BlimpView using a cl
shaktisahu
2016/04/28 21:38:15
Done.
| |
| 72 | |
| 65 DISALLOW_COPY_AND_ASSIGN(BlimpCompositorManagerAndroid); | 73 DISALLOW_COPY_AND_ASSIGN(BlimpCompositorManagerAndroid); |
| 66 }; | 74 }; |
| 67 | 75 |
| 68 } // namespace client | 76 } // namespace client |
| 69 } // namespace blimp | 77 } // namespace blimp |
| 70 | 78 |
| 71 #endif // BLIMP_CLIENT_APP_ANDROID_BLIMP_COMPOSITOR_MANAGER_ANDROID_H_ | 79 #endif // BLIMP_CLIENT_APP_ANDROID_BLIMP_COMPOSITOR_MANAGER_ANDROID_H_ |
| OLD | NEW |