Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(920)

Unified Diff: cc/output/direct_renderer.h

Issue 2194013002: cc: Delete the Renderer base class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dcheck-delegating
Patch Set: delete-renderer-base-class: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/output/direct_renderer.h
diff --git a/cc/output/direct_renderer.h b/cc/output/direct_renderer.h
index d10962aeaf7c8a52dbf386add0013fa8fd57e43f..1fed523a556e92266810b808ba545755a0c52c8b 100644
--- a/cc/output/direct_renderer.h
+++ b/cc/output/direct_renderer.h
@@ -22,22 +22,37 @@
namespace cc {
class DrawPolygon;
class ResourceProvider;
+typedef std::vector<std::unique_ptr<RenderPass>> RenderPassList;
+
+class CC_EXPORT DirectRendererClient {
+ public:
+ virtual void SetFullRootLayerDamage() = 0;
+};
// This is the base class for code shared between the GL and software
// renderer implementations. "Direct" refers to the fact that it does not
// delegate rendering to another compositor.
-class CC_EXPORT DirectRenderer : public Renderer {
+class CC_EXPORT DirectRenderer {
public:
- ~DirectRenderer() override;
+ DirectRenderer(DirectRendererClient* client,
+ const RendererSettings* settings,
+ OutputSurface* output_surface,
+ ResourceProvider* resource_provider);
+ virtual ~DirectRenderer();
void DecideRenderPassAllocationsForFrame(
- const RenderPassList& render_passes_in_draw_order) override;
- bool HasAllocatedResourcesForTesting(RenderPassId id) const override;
+ const RenderPassList& render_passes_in_draw_order);
+ bool HasAllocatedResourcesForTesting(RenderPassId id) const;
void DrawFrame(RenderPassList* render_passes_in_draw_order,
float device_scale_factor,
const gfx::ColorSpace& device_color_space,
const gfx::Rect& device_viewport_rect,
- const gfx::Rect& device_clip_rect) override;
+ const gfx::Rect& device_clip_rect);
+ virtual void SwapBuffers(CompositorFrameMetadata metadata) = 0;
+
+ virtual const RendererCapabilitiesImpl& Capabilities() const = 0;
+
+ // DO THIS: protected:
enne (OOO) 2016/08/08 21:41:18 ?
virtual void SwapBuffersComplete() {}
virtual void DidReceiveTextureInUseResponses(
const gpu::TextureInUseResponses& responses) {}
@@ -85,11 +100,6 @@ class CC_EXPORT DirectRenderer : public Renderer {
SURFACE_INITIALIZATION_MODE_FULL_SURFACE_CLEAR,
};
- DirectRenderer(RendererClient* client,
- const RendererSettings* settings,
- OutputSurface* output_surface,
- ResourceProvider* resource_provider);
-
static gfx::RectF QuadVertexRect();
static void QuadRectTransform(gfx::Transform* quad_rect_transform,
const gfx::Transform& quad_transform,
@@ -146,13 +156,16 @@ class CC_EXPORT DirectRenderer : public Renderer {
virtual bool FlippedFramebuffer(const DrawingFrame* frame) const = 0;
virtual void EnsureScissorTestEnabled() = 0;
virtual void EnsureScissorTestDisabled() = 0;
- virtual void DiscardBackbuffer() {}
- virtual void EnsureBackbuffer() {}
virtual void CopyCurrentRenderPassToBitmap(
DrawingFrame* frame,
std::unique_ptr<CopyOutputRequest> request) = 0;
+ DirectRendererClient* const client_;
+ const RendererSettings* const settings_;
+ OutputSurface* const output_surface_;
+ ResourceProvider* const resource_provider_;
+
// TODO(danakj): Just use a vector of pairs here? Hash map is way overkill.
std::unordered_map<RenderPassId,
std::unique_ptr<ScopedResource>,
@@ -160,8 +173,6 @@ class CC_EXPORT DirectRenderer : public Renderer {
render_pass_textures_;
std::unordered_map<RenderPassId, TileDrawQuad, RenderPassIdHash>
render_pass_bypass_quads_;
- OutputSurface* output_surface_;
- ResourceProvider* resource_provider_;
std::unique_ptr<OverlayProcessor> overlay_processor_;
// For use in coordinate conversion, this stores the output rect, viewport

Powered by Google App Engine
This is Rietveld 408576698