summaryrefslogtreecommitdiffstats
path: root/cc/content_layer.h
diff options
context:
space:
mode:
Diffstat (limited to 'cc/content_layer.h')
-rw-r--r--cc/content_layer.h66
1 files changed, 65 insertions, 1 deletions
diff --git a/cc/content_layer.h b/cc/content_layer.h
index 638cbb2..b8ac462 100644
--- a/cc/content_layer.h
+++ b/cc/content_layer.h
@@ -1,3 +1,67 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
+// Copyright 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+
+
+#ifndef ContentLayerChromium_h
+#define ContentLayerChromium_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "base/basictypes.h"
+#include "LayerPainterChromium.h"
+#include "TiledLayerChromium.h"
+
+class SkCanvas;
+
+namespace cc {
+
+class ContentLayerChromiumClient;
+class FloatRect;
+class IntRect;
+class LayerTextureUpdater;
+
+class ContentLayerPainter : public LayerPainterChromium {
+public:
+ static PassOwnPtr<ContentLayerPainter> create(ContentLayerChromiumClient*);
+
+ virtual void paint(SkCanvas*, const IntRect& contentRect, FloatRect& opaque) OVERRIDE;
+
+private:
+ explicit ContentLayerPainter(ContentLayerChromiumClient*);
+
+ ContentLayerChromiumClient* m_client;
+
+ DISALLOW_COPY_AND_ASSIGN(ContentLayerPainter);
+};
+
+// A layer that renders its contents into an SkCanvas.
+class ContentLayerChromium : public TiledLayerChromium {
+public:
+ static scoped_refptr<ContentLayerChromium> create(ContentLayerChromiumClient*);
+
+ void clearClient() { m_client = 0; }
+
+ virtual bool drawsContent() const OVERRIDE;
+ virtual void setTexturePriorities(const CCPriorityCalculator&) OVERRIDE;
+ virtual void update(CCTextureUpdateQueue&, const CCOcclusionTracker*, CCRenderingStats&) OVERRIDE;
+ virtual bool needMoreUpdates() OVERRIDE;
+
+ virtual void setContentsOpaque(bool) OVERRIDE;
+
+protected:
+ explicit ContentLayerChromium(ContentLayerChromiumClient*);
+ virtual ~ContentLayerChromium();
+
+private:
+ virtual LayerTextureUpdater* textureUpdater() const OVERRIDE;
+ virtual void createTextureUpdaterIfNeeded() OVERRIDE;
+
+ ContentLayerChromiumClient* m_client;
+ RefPtr<LayerTextureUpdater> m_textureUpdater;
+};
+
+}
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif