#include "cc/quads/render_pass.h"
#include "cc/resources/resource_provider.h"
#include "cc/resources/tile_manager.h"
+#include "cc/scheduler/draw_swap_readback_result.h"
#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/rect.h"
// LayerTreeHost->Proxy callback interface.
class LayerTreeHostImplClient {
public:
+ virtual void UpdateRendererCapabilitiesOnImplThread() = 0;
virtual void DidLoseOutputSurfaceOnImplThread() = 0;
virtual void DidSwapBuffersOnImplThread() = 0;
virtual void OnSwapBuffersCompleteOnImplThread() = 0;
virtual void PinchGestureUpdate(float magnify_delta,
gfx::Point anchor) OVERRIDE;
virtual void PinchGestureEnd() OVERRIDE;
- virtual void StartPageScaleAnimation(gfx::Vector2d target_offset,
+ virtual void StartPageScaleAnimation(const gfx::Vector2d& target_offset,
bool anchor_point,
float page_scale,
base::TimeDelta duration) OVERRIDE;
// to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers
// must also be called, regardless of whether DrawLayers is called between the
// two.
- virtual bool PrepareToDraw(FrameData* frame,
- const gfx::Rect& damage_rect);
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDraw(
+ FrameData* frame,
+ const gfx::Rect& damage_rect);
virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time);
// Must be called if and only if PrepareToDraw was called.
void DidDrawAllLayers(const FrameData& frame);
// excludes the URL bar and non-overlay scrollbars and is in DIP (and
// invariant relative to page scale).
gfx::SizeF UnscaledScrollableViewportSize() const;
+ float VerticalAdjust() const;
// RendererClient implementation.
virtual void SetFullRootLayerDamage() OVERRIDE;
// Shortcuts to layers on the active tree.
LayerImpl* RootLayer() const;
- LayerImpl* RootScrollLayer() const;
+ LayerImpl* InnerViewportScrollLayer() const;
+ LayerImpl* OuterViewportScrollLayer() const;
LayerImpl* CurrentlyScrollingLayer() const;
int scroll_layer_id_when_mouse_over_scrollbar() {
size_t memory_allocation_limit_bytes() const;
int memory_allocation_priority_cutoff() const;
- void SetViewportSize(gfx::Size device_viewport_size);
+ void SetViewportSize(const gfx::Size& device_viewport_size);
void SetOverdrawBottomHeight(float overdraw_bottom_height);
float overdraw_bottom_height() const { return overdraw_bottom_height_; }
void SetOverhangUIResource(UIResourceId overhang_ui_resource_id,
- gfx::Size overhang_ui_resource_size);
+ const gfx::Size& overhang_ui_resource_size);
void SetDeviceScaleFactor(float device_scale_factor);
float device_scale_factor() const { return device_scale_factor_; }
SharedBitmapManager* manager,
int id);
+ gfx::SizeF ComputeInnerViewportContainerSize() const;
+ void UpdateInnerViewportContainerSize();
+
// Virtual for testing.
virtual void AnimateLayers(base::TimeTicks monotonic_time,
base::Time wall_clock_time);
bool skip_gl_renderer);
void CreateAndSetTileManager(ResourceProvider* resource_provider,
ContextProvider* context_provider,
- bool using_map_image);
+ bool using_map_image,
+ bool allow_rasterize_on_demand);
void ReleaseTreeResources();
void EnforceZeroBudget(bool zero_budget);
+ void ScrollViewportBy(gfx::Vector2dF scroll_delta);
void AnimatePageScale(base::TimeTicks monotonic_time);
void AnimateScrollbars(base::TimeTicks monotonic_time);
void AnimateTopControls(base::TimeTicks monotonic_time);
const gfx::PointF& viewport_point,
const gfx::Vector2dF& viewport_delta);
- void UpdateMaxScrollOffset();
void TrackDamageForAllSurfaces(
LayerImpl* root_draw_layer,
const LayerImplList& render_surface_layer_list);
void UpdateTileManagerMemoryPolicy(const ManagedMemoryPolicy& policy);
- // Returns false if the frame should not be displayed. This function should
- // only be called from PrepareToDraw, as DidDrawAllLayers must be called
- // if this helper function is called.
- bool CalculateRenderPasses(FrameData* frame);
+ // This function should only be called from PrepareToDraw, as DidDrawAllLayers
+ // must be called if this helper function is called. Returns DRAW_SUCCESS if
+ // the frame should be drawn.
+ DrawSwapReadbackResult::DrawResult CalculateRenderPasses(FrameData* frame);
void SendReleaseResourcesRecursive(LayerImpl* current);
bool EnsureRenderSurfaceLayerList();