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" |
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 ScopedResource; | 17 class ScopedResource; |
18 | 18 |
19 struct RendererCapabilitiesImpl { | 19 struct RendererCapabilitiesImpl { |
20 RendererCapabilitiesImpl(); | 20 RendererCapabilitiesImpl(); |
21 ~RendererCapabilitiesImpl(); | 21 ~RendererCapabilitiesImpl(); |
22 | 22 |
23 // Capabilities copied to main thread. | 23 // Capabilities copied to main thread. |
24 ResourceFormat best_texture_format; | 24 ResourceFormat best_texture_format; |
25 bool allow_partial_texture_updates; | 25 bool allow_partial_texture_updates; |
26 bool using_offscreen_context3d; | |
27 int max_texture_size; | 26 int max_texture_size; |
28 bool using_shared_memory_resources; | 27 bool using_shared_memory_resources; |
29 | 28 |
30 // Capabilities used on compositor thread only. | 29 // Capabilities used on compositor thread only. |
31 bool using_partial_swap; | 30 bool using_partial_swap; |
32 bool using_egl_image; | 31 bool using_egl_image; |
33 bool avoid_pow2_textures; | 32 bool avoid_pow2_textures; |
34 bool using_map_image; | 33 bool using_map_image; |
35 bool using_discard_framebuffer; | 34 bool using_discard_framebuffer; |
36 bool allow_rasterize_on_demand; | 35 bool allow_rasterize_on_demand; |
(...skipping 17 matching lines...) Expand all Loading... |
54 virtual void DecideRenderPassAllocationsForFrame( | 53 virtual void DecideRenderPassAllocationsForFrame( |
55 const RenderPassList& render_passes_in_draw_order) {} | 54 const RenderPassList& render_passes_in_draw_order) {} |
56 virtual bool HasAllocatedResourcesForTesting(RenderPass::Id id) const; | 55 virtual bool HasAllocatedResourcesForTesting(RenderPass::Id id) const; |
57 | 56 |
58 // This passes ownership of the render passes to the renderer. It should | 57 // This passes ownership of the render passes to the renderer. It should |
59 // consume them, and empty the list. The parameters here may change from frame | 58 // consume them, and empty the list. The parameters here may change from frame |
60 // to frame and should not be cached. | 59 // to frame and should not be cached. |
61 // The |device_viewport_rect| and |device_clip_rect| are in non-y-flipped | 60 // The |device_viewport_rect| and |device_clip_rect| are in non-y-flipped |
62 // window space. | 61 // window space. |
63 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order, | 62 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order, |
64 ContextProvider* offscreen_context_provider, | |
65 float device_scale_factor, | 63 float device_scale_factor, |
66 const gfx::Rect& device_viewport_rect, | 64 const gfx::Rect& device_viewport_rect, |
67 const gfx::Rect& device_clip_rect, | 65 const gfx::Rect& device_clip_rect, |
68 bool disable_picture_quad_image_filtering) = 0; | 66 bool disable_picture_quad_image_filtering) = 0; |
69 | 67 |
70 // Waits for rendering to finish. | 68 // Waits for rendering to finish. |
71 virtual void Finish() = 0; | 69 virtual void Finish() = 0; |
72 | 70 |
73 virtual void DoNoOp() {} | 71 virtual void DoNoOp() {} |
74 | 72 |
(...skipping 18 matching lines...) Expand all Loading... |
93 RendererClient* client_; | 91 RendererClient* client_; |
94 const LayerTreeSettings* settings_; | 92 const LayerTreeSettings* settings_; |
95 | 93 |
96 private: | 94 private: |
97 DISALLOW_COPY_AND_ASSIGN(Renderer); | 95 DISALLOW_COPY_AND_ASSIGN(Renderer); |
98 }; | 96 }; |
99 | 97 |
100 } // namespace cc | 98 } // namespace cc |
101 | 99 |
102 #endif // CC_OUTPUT_RENDERER_H_ | 100 #endif // CC_OUTPUT_RENDERER_H_ |
OLD | NEW |