X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcc%2Foutput%2Frenderer.h;h=14fc6413f996d019f3601469c8841f2857128eb8;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=693cd0c2705ce33e84676e3da5aae1adc86f3236;hpb=4b53d56b8a1db20d4089f6d4f37126d43f907125;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/cc/output/renderer.h b/src/cc/output/renderer.h index 693cd0c..14fc641 100644 --- a/src/cc/output/renderer.h +++ b/src/cc/output/renderer.h @@ -16,27 +16,38 @@ class CompositorFrameAck; class CompositorFrameMetadata; class ScopedResource; +struct RendererCapabilitiesImpl { + RendererCapabilitiesImpl(); + ~RendererCapabilitiesImpl(); + + // Capabilities copied to main thread. + ResourceFormat best_texture_format; + bool allow_partial_texture_updates; + bool using_offscreen_context3d; + int max_texture_size; + bool using_shared_memory_resources; + + // Capabilities used on compositor thread only. + bool using_partial_swap; + bool using_egl_image; + bool avoid_pow2_textures; + bool using_map_image; + bool using_discard_framebuffer; + bool allow_rasterize_on_demand; + + RendererCapabilities MainThreadCapabilities() const; +}; + class CC_EXPORT RendererClient { public: - // These return the draw viewport and clip in non-y-flipped window space. - // Note that while a draw is in progress, these are guaranteed to be - // contained within the output surface size. - virtual gfx::Rect DeviceViewport() const = 0; - virtual gfx::Rect DeviceClip() const = 0; virtual void SetFullRootLayerDamage() = 0; - virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const = 0; - - protected: - virtual ~RendererClient() {} }; class CC_EXPORT Renderer { public: virtual ~Renderer() {} - virtual const RendererCapabilities& Capabilities() const = 0; - - virtual void ViewportChanged() {} + virtual const RendererCapabilitiesImpl& Capabilities() const = 0; virtual bool CanReadPixels() const = 0; @@ -47,9 +58,13 @@ class CC_EXPORT Renderer { // This passes ownership of the render passes to the renderer. It should // consume them, and empty the list. The parameters here may change from frame // to frame and should not be cached. + // The |device_viewport_rect| and |device_clip_rect| are in non-y-flipped + // window space. virtual void DrawFrame(RenderPassList* render_passes_in_draw_order, ContextProvider* offscreen_context_provider, float device_scale_factor, + const gfx::Rect& device_viewport_rect, + const gfx::Rect& device_clip_rect, bool allow_partial_swap, bool disable_picture_quad_image_filtering) = 0; @@ -59,10 +74,10 @@ class CC_EXPORT Renderer { virtual void DoNoOp() {} // Puts backbuffer onscreen. - virtual void SwapBuffers() = 0; + virtual void SwapBuffers(const CompositorFrameMetadata& metadata) = 0; virtual void ReceiveSwapBuffersAck(const CompositorFrameAck& ack) {} - virtual void GetFramebufferPixels(void* pixels, gfx::Rect rect) = 0; + virtual void GetFramebufferPixels(void* pixels, const gfx::Rect& rect) = 0; virtual bool IsContextLost();