OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.chrome.browser.compositor.layouts; |
| 6 |
| 7 import android.graphics.Rect; |
| 8 |
| 9 import org.chromium.chrome.browser.compositor.layouts.components.LayoutTab; |
| 10 import org.chromium.ui.resources.ResourceManager; |
| 11 |
| 12 /** |
| 13 * {@link LayoutRenderHost} is the minimal interface the layouts need to know ab
out its host to |
| 14 * render. |
| 15 */ |
| 16 public interface LayoutRenderHost { |
| 17 /** |
| 18 * Request layout and draw. |
| 19 */ |
| 20 void requestRender(); |
| 21 |
| 22 /** |
| 23 * Indicates that we are about to draw and final layout changes should be ma
de. |
| 24 */ |
| 25 void onCompositorLayout(); |
| 26 |
| 27 /** |
| 28 * Indicates that a previously rendered frame has been swapped to the OS. |
| 29 */ |
| 30 void onSwapBuffersCompleted(int pendingSwapBuffersCount); |
| 31 |
| 32 /** |
| 33 * Indicates that the rendering surface has just been created. |
| 34 */ |
| 35 void onSurfaceCreated(); |
| 36 |
| 37 /** |
| 38 * Indicates that the rendering surface has been resized. |
| 39 */ |
| 40 void onPhysicalBackingSizeChanged(int width, int height); |
| 41 |
| 42 /** |
| 43 * Indicates that the amount the surface is overdrawing on the bottom has ch
anged. |
| 44 * |
| 45 * This occurs when the surface is larger than the window viewport. |
| 46 * |
| 47 * @param overdrawHeight The overdraw amount. |
| 48 */ |
| 49 void onOverdrawBottomHeightChanged(int overdrawHeight); |
| 50 |
| 51 /** |
| 52 * @see #onOverdrawBottomHeightChanged(int) |
| 53 * @return The overdraw bottom height of the last frame rendered by the curr
ent tab. |
| 54 */ |
| 55 int getCurrentOverdrawBottomHeight(); |
| 56 |
| 57 /** |
| 58 * @return The number of actually drawn {@link LayoutTab}. |
| 59 */ |
| 60 int getLayoutTabsDrawnCount(); |
| 61 |
| 62 /** |
| 63 * Pushes a debug rectangle that will be drawn. |
| 64 * |
| 65 * @param rect The rect to be drawn. |
| 66 * @param color The color of the rect. |
| 67 */ |
| 68 void pushDebugRect(Rect rect, int color); |
| 69 |
| 70 /** |
| 71 * Loads the persistent textures if they are not loaded already. |
| 72 */ |
| 73 void loadPersitentTextureDataIfNeeded(); |
| 74 |
| 75 /** |
| 76 * @param rect Rect instance to be used to store the result and return. If n
ull, it uses a new |
| 77 * Rect instance. |
| 78 * @return The current visible viewport of the host (takes fullscreen into a
ccount). |
| 79 */ |
| 80 Rect getVisibleViewport(Rect rect); |
| 81 |
| 82 /** |
| 83 * @return Whether or not the toolbar is currently being faked. |
| 84 */ |
| 85 boolean areTopControlsPermanentlyHidden(); |
| 86 |
| 87 /** |
| 88 * @return The height of the top controls in pixels. |
| 89 */ |
| 90 int getTopControlsHeightPixels(); |
| 91 |
| 92 /** |
| 93 * @return The {@link ResourceManager}. |
| 94 */ |
| 95 ResourceManager getResourceManager(); |
| 96 |
| 97 /** |
| 98 * Called when something has changed in the Compositor rendered view system. |
| 99 */ |
| 100 void invalidateAccessibilityProvider(); |
| 101 } |
OLD | NEW |