summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/LayerAndroid.h
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2011-11-04 13:56:14 -0700
committerNicolas Roard <nicolasroard@google.com>2011-11-10 18:27:56 -0800
commit5997528e55d0dc6734718bde61faa8513b1dd54f (patch)
tree62b22677aeffd0f36ee9aa5c283e7eaab9cf9b1d /Source/WebCore/platform/graphics/android/LayerAndroid.h
parentc97291b2e7a966abf8dbad5cf2e0e8b033c3cd90 (diff)
downloadexternal_webkit-5997528e55d0dc6734718bde61faa8513b1dd54f.zip
external_webkit-5997528e55d0dc6734718bde61faa8513b1dd54f.tar.gz
external_webkit-5997528e55d0dc6734718bde61faa8513b1dd54f.tar.bz2
Fallback mode when running out of textures for layers
- Implements a degraded rendering mode when running out of textures - Speed up rendering by reusing the same SkBitmap in RasterRenderer - Some refactoring bug:5279231 Change-Id: I52943a87bed56c49b01b47fea4fa1a5c49e09e93
Diffstat (limited to 'Source/WebCore/platform/graphics/android/LayerAndroid.h')
-rw-r--r--Source/WebCore/platform/graphics/android/LayerAndroid.h35
1 files changed, 33 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.h b/Source/WebCore/platform/graphics/android/LayerAndroid.h
index 15a581e..b536b22 100644
--- a/Source/WebCore/platform/graphics/android/LayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/LayerAndroid.h
@@ -99,9 +99,25 @@ class RenderLayer;
class TiledPage;
class PaintedSurface;
+class TexturesResult {
+public:
+ TexturesResult()
+ : fixed(0)
+ , scrollable(0)
+ , clipped(0)
+ , full(0)
+ {}
+
+ int fixed;
+ int scrollable;
+ int clipped;
+ int full;
+};
+
class LayerAndroid : public Layer {
public:
enum LayerType { UndefinedLayer, WebCoreLayer, UILayer, NavCacheLayer };
+
LayerAndroid(RenderLayer* owner);
LayerAndroid(const LayerAndroid& layer);
LayerAndroid(SkPicture*);
@@ -121,6 +137,9 @@ public:
IntRect clippedRect() const;
bool outsideViewport();
+ IntRect unclippedArea();
+ IntRect visibleArea();
+
virtual bool needsTexture();
void removeTexture(PaintedSurface*);
@@ -129,11 +148,17 @@ public:
int nbTexturedLayers();
void showLayer(int indent);
+ void computeTexturesAmount(TexturesResult*);
+
float getScale() { return m_scale; }
+ void setState(GLWebViewState*);
+
// draw layer and its children via Z, pre-order traversal
virtual bool drawGL(GLWebViewState*, SkMatrix&);
bool drawChildrenGL(GLWebViewState*, SkMatrix&);
+ virtual bool drawCanvas(SkCanvas*);
+ bool drawChildrenCanvas(SkCanvas*);
// prepare layer and its children via reverse-Z, post-order traversal
void prepare(GLWebViewState*);
@@ -212,7 +237,7 @@ public:
This call is recursive, so it should be called on the root of the
hierarchy.
*/
- void updateFixedLayersPositions(SkRect viewPort, LayerAndroid* parentIframeLayer = 0);
+ bool updateFixedLayersPositions(SkRect viewPort, LayerAndroid* parentIframeLayer = 0);
/** Call this to update the position attribute, so that later calls
like bounds() will report the corrected position.
@@ -284,6 +309,9 @@ public:
ImageTexture* imageTexture() { return m_imageTexture; }
int type() { return m_type; }
+ bool hasText() { return m_hasText; }
+ void checkTextPresence();
+
protected:
virtual void onDraw(SkCanvas*, SkScalar opacity);
@@ -387,8 +415,11 @@ private:
RenderLayer* m_owningLayer;
- GLWebViewState* m_state;
int m_type;
+ GLWebViewState* m_state;
+
+ bool m_hasText;
+
typedef Layer INHERITED;
};