| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 CC_OUTPUT_RENDERER_H_ | 5 #ifndef CC_OUTPUT_RENDERER_H_ |
| 6 #define CC_OUTPUT_RENDERER_H_ | 6 #define CC_OUTPUT_RENDERER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 10 #include "cc/quads/render_pass.h" | 10 #include "cc/quads/render_pass.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 virtual bool HasAllocatedResourcesForTesting(RenderPass::Id id) const; | 34 virtual bool HasAllocatedResourcesForTesting(RenderPass::Id id) const; |
| 35 | 35 |
| 36 // This passes ownership of the render passes to the renderer. It should | 36 // This passes ownership of the render passes to the renderer. It should |
| 37 // consume them, and empty the list. The parameters here may change from frame | 37 // consume them, and empty the list. The parameters here may change from frame |
| 38 // to frame and should not be cached. | 38 // to frame and should not be cached. |
| 39 // The |device_viewport_rect| and |device_clip_rect| are in non-y-flipped | 39 // The |device_viewport_rect| and |device_clip_rect| are in non-y-flipped |
| 40 // window space. | 40 // window space. |
| 41 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order, | 41 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order, |
| 42 ContextProvider* offscreen_context_provider, | 42 ContextProvider* offscreen_context_provider, |
| 43 float device_scale_factor, | 43 float device_scale_factor, |
| 44 gfx::Rect device_viewport_rect, | 44 const gfx::Rect& device_viewport_rect, |
| 45 gfx::Rect device_clip_rect, | 45 const gfx::Rect& device_clip_rect, |
| 46 bool allow_partial_swap, | 46 bool allow_partial_swap, |
| 47 bool disable_picture_quad_image_filtering) = 0; | 47 bool disable_picture_quad_image_filtering) = 0; |
| 48 | 48 |
| 49 // Waits for rendering to finish. | 49 // Waits for rendering to finish. |
| 50 virtual void Finish() = 0; | 50 virtual void Finish() = 0; |
| 51 | 51 |
| 52 virtual void DoNoOp() {} | 52 virtual void DoNoOp() {} |
| 53 | 53 |
| 54 // Puts backbuffer onscreen. | 54 // Puts backbuffer onscreen. |
| 55 virtual void SwapBuffers(const CompositorFrameMetadata& metadata) = 0; | 55 virtual void SwapBuffers(const CompositorFrameMetadata& metadata) = 0; |
| 56 virtual void ReceiveSwapBuffersAck(const CompositorFrameAck& ack) {} | 56 virtual void ReceiveSwapBuffersAck(const CompositorFrameAck& ack) {} |
| 57 | 57 |
| 58 virtual void GetFramebufferPixels(void* pixels, gfx::Rect rect) = 0; | 58 virtual void GetFramebufferPixels(void* pixels, const gfx::Rect& rect) = 0; |
| 59 | 59 |
| 60 virtual bool IsContextLost(); | 60 virtual bool IsContextLost(); |
| 61 | 61 |
| 62 virtual void SetVisible(bool visible) = 0; | 62 virtual void SetVisible(bool visible) = 0; |
| 63 | 63 |
| 64 virtual void SendManagedMemoryStats(size_t bytes_visible, | 64 virtual void SendManagedMemoryStats(size_t bytes_visible, |
| 65 size_t bytes_visible_and_nearby, | 65 size_t bytes_visible_and_nearby, |
| 66 size_t bytes_allocated) = 0; | 66 size_t bytes_allocated) = 0; |
| 67 | 67 |
| 68 protected: | 68 protected: |
| 69 explicit Renderer(RendererClient* client, const LayerTreeSettings* settings) | 69 explicit Renderer(RendererClient* client, const LayerTreeSettings* settings) |
| 70 : client_(client), settings_(settings) {} | 70 : client_(client), settings_(settings) {} |
| 71 | 71 |
| 72 RendererClient* client_; | 72 RendererClient* client_; |
| 73 const LayerTreeSettings* settings_; | 73 const LayerTreeSettings* settings_; |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 DISALLOW_COPY_AND_ASSIGN(Renderer); | 76 DISALLOW_COPY_AND_ASSIGN(Renderer); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 } // namespace cc | 79 } // namespace cc |
| 80 | 80 |
| 81 #endif // CC_OUTPUT_RENDERER_H_ | 81 #endif // CC_OUTPUT_RENDERER_H_ |
| OLD | NEW |