| 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/base/scoped_ptr_vector.h" |
| 11 #include "cc/trees/layer_tree_host.h" | 11 #include "cc/trees/layer_tree_host.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 | 14 |
| 15 class CompositorFrameAck; | 15 class CompositorFrameAck; |
| 16 class CompositorFrameMetadata; | 16 class CompositorFrameMetadata; |
| 17 class RenderPass; |
| 18 class RenderPassId; |
| 17 class ScopedResource; | 19 class ScopedResource; |
| 18 class Task; | 20 class Task; |
| 19 | 21 |
| 22 typedef ScopedPtrVector<RenderPass> RenderPassList; |
| 23 |
| 20 struct RendererCapabilitiesImpl { | 24 struct RendererCapabilitiesImpl { |
| 21 RendererCapabilitiesImpl(); | 25 RendererCapabilitiesImpl(); |
| 22 ~RendererCapabilitiesImpl(); | 26 ~RendererCapabilitiesImpl(); |
| 23 | 27 |
| 24 // Capabilities copied to main thread. | 28 // Capabilities copied to main thread. |
| 25 ResourceFormat best_texture_format; | 29 ResourceFormat best_texture_format; |
| 26 bool allow_partial_texture_updates; | 30 bool allow_partial_texture_updates; |
| 27 int max_texture_size; | 31 int max_texture_size; |
| 28 bool using_shared_memory_resources; | 32 bool using_shared_memory_resources; |
| 29 | 33 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 44 }; | 48 }; |
| 45 | 49 |
| 46 class CC_EXPORT Renderer { | 50 class CC_EXPORT Renderer { |
| 47 public: | 51 public: |
| 48 virtual ~Renderer() {} | 52 virtual ~Renderer() {} |
| 49 | 53 |
| 50 virtual const RendererCapabilitiesImpl& Capabilities() const = 0; | 54 virtual const RendererCapabilitiesImpl& Capabilities() const = 0; |
| 51 | 55 |
| 52 virtual void DecideRenderPassAllocationsForFrame( | 56 virtual void DecideRenderPassAllocationsForFrame( |
| 53 const RenderPassList& render_passes_in_draw_order) {} | 57 const RenderPassList& render_passes_in_draw_order) {} |
| 54 virtual bool HasAllocatedResourcesForTesting(RenderPass::Id id) const; | 58 virtual bool HasAllocatedResourcesForTesting(RenderPassId id) const; |
| 55 | 59 |
| 56 // This passes ownership of the render passes to the renderer. It should | 60 // This passes ownership of the render passes to the renderer. It should |
| 57 // consume them, and empty the list. The parameters here may change from frame | 61 // consume them, and empty the list. The parameters here may change from frame |
| 58 // to frame and should not be cached. | 62 // to frame and should not be cached. |
| 59 // The |device_viewport_rect| and |device_clip_rect| are in non-y-flipped | 63 // The |device_viewport_rect| and |device_clip_rect| are in non-y-flipped |
| 60 // window space. | 64 // window space. |
| 61 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order, | 65 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order, |
| 62 float device_scale_factor, | 66 float device_scale_factor, |
| 63 const gfx::Rect& device_viewport_rect, | 67 const gfx::Rect& device_viewport_rect, |
| 64 const gfx::Rect& device_clip_rect, | 68 const gfx::Rect& device_clip_rect, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 86 const LayerTreeSettings* settings_; | 90 const LayerTreeSettings* settings_; |
| 87 bool visible_; | 91 bool visible_; |
| 88 | 92 |
| 89 private: | 93 private: |
| 90 DISALLOW_COPY_AND_ASSIGN(Renderer); | 94 DISALLOW_COPY_AND_ASSIGN(Renderer); |
| 91 }; | 95 }; |
| 92 | 96 |
| 93 } // namespace cc | 97 } // namespace cc |
| 94 | 98 |
| 95 #endif // CC_OUTPUT_RENDERER_H_ | 99 #endif // CC_OUTPUT_RENDERER_H_ |
| OLD | NEW |