| 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/debug/latency_info.h" | |
| 11 #include "cc/quads/render_pass.h" | 10 #include "cc/quads/render_pass.h" |
| 12 #include "cc/resources/managed_memory_policy.h" | 11 #include "cc/resources/managed_memory_policy.h" |
| 13 #include "cc/trees/layer_tree_host.h" | 12 #include "cc/trees/layer_tree_host.h" |
| 13 #include "ui/base/latency_info.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 | 16 |
| 17 class CompositorFrameAck; | 17 class CompositorFrameAck; |
| 18 class CompositorFrameMetadata; | 18 class CompositorFrameMetadata; |
| 19 class ScopedResource; | 19 class ScopedResource; |
| 20 | 20 |
| 21 class CC_EXPORT RendererClient { | 21 class CC_EXPORT RendererClient { |
| 22 public: | 22 public: |
| 23 virtual gfx::Size DeviceViewportSize() const = 0; | 23 virtual gfx::Size DeviceViewportSize() const = 0; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // This passes ownership of the render passes to the renderer. It should | 62 // This passes ownership of the render passes to the renderer. It should |
| 63 // consume them, and empty the list. | 63 // consume them, and empty the list. |
| 64 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order) = 0; | 64 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order) = 0; |
| 65 | 65 |
| 66 // Waits for rendering to finish. | 66 // Waits for rendering to finish. |
| 67 virtual void Finish() = 0; | 67 virtual void Finish() = 0; |
| 68 | 68 |
| 69 virtual void DoNoOp() {} | 69 virtual void DoNoOp() {} |
| 70 | 70 |
| 71 // Puts backbuffer onscreen. | 71 // Puts backbuffer onscreen. |
| 72 virtual void SwapBuffers(const LatencyInfo& latency_info) = 0; | 72 virtual void SwapBuffers(const ui::LatencyInfo& latency_info) = 0; |
| 73 | 73 |
| 74 virtual void GetFramebufferPixels(void* pixels, gfx::Rect rect) = 0; | 74 virtual void GetFramebufferPixels(void* pixels, gfx::Rect rect) = 0; |
| 75 | 75 |
| 76 virtual bool IsContextLost(); | 76 virtual bool IsContextLost(); |
| 77 | 77 |
| 78 virtual void SetVisible(bool visible) = 0; | 78 virtual void SetVisible(bool visible) = 0; |
| 79 | 79 |
| 80 virtual void SendManagedMemoryStats(size_t bytes_visible, | 80 virtual void SendManagedMemoryStats(size_t bytes_visible, |
| 81 size_t bytes_visible_and_nearby, | 81 size_t bytes_visible_and_nearby, |
| 82 size_t bytes_allocated) = 0; | 82 size_t bytes_allocated) = 0; |
| 83 | 83 |
| 84 protected: | 84 protected: |
| 85 explicit Renderer(RendererClient* client) | 85 explicit Renderer(RendererClient* client) |
| 86 : client_(client) {} | 86 : client_(client) {} |
| 87 | 87 |
| 88 RendererClient* client_; | 88 RendererClient* client_; |
| 89 | 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(Renderer); | 90 DISALLOW_COPY_AND_ASSIGN(Renderer); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace cc | 93 } // namespace cc |
| 94 | 94 |
| 95 #endif // CC_OUTPUT_RENDERER_H_ | 95 #endif // CC_OUTPUT_RENDERER_H_ |
| OLD | NEW |