summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2012-04-06 15:16:28 -0700
committerNicolas Roard <nicolasroard@google.com>2012-04-24 11:54:25 -0700
commita15d30f54c6edc68da7e82c198b5916dd023ac4d (patch)
tree6f7040096043ac04a72600144a51a274f1096b2f /Source/WebCore/platform/graphics/android/rendering/Surface.cpp
parent492bcfac9fc25b61f44811050fb0cfe827eb6a08 (diff)
downloadexternal_webkit-a15d30f54c6edc68da7e82c198b5916dd023ac4d.zip
external_webkit-a15d30f54c6edc68da7e82c198b5916dd023ac4d.tar.gz
external_webkit-a15d30f54c6edc68da7e82c198b5916dd023ac4d.tar.bz2
CSS Background image implementation
bug:1352305 Change-Id: Id9caaae9b9442729110b52c75004f634d8284db4
Diffstat (limited to 'Source/WebCore/platform/graphics/android/rendering/Surface.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/Surface.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/Surface.cpp b/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
index a9ebd1e..563b0f5 100644
--- a/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
@@ -38,6 +38,8 @@
#include "SurfaceBacking.h"
#include "TilesManager.h"
+#include <wtf/text/CString.h>
+
// Surfaces with an area larger than 2048*2048 should never be unclipped
#define MAX_UNCLIPPED_AREA 4194304
@@ -199,8 +201,13 @@ void Surface::prepareGL(bool layerTilesDisabled)
IntRect prepareArea = computePrepareArea();
IntRect fullArea = unclippedArea();
- ALOGV("prepareGL on Surf %p with SurfBack %p, %d layers",
- this, m_surfaceBacking, m_layers.size());
+ ALOGV("prepareGL on Surf %p with SurfBack %p, %d layers, first layer %s (%d) "
+ "prepareArea(%d, %d - %d x %d) fullArea(%d, %d - %d x %d)",
+ this, m_surfaceBacking, m_layers.size(),
+ getFirstLayer()->subclassName().ascii().data(),
+ getFirstLayer()->uniqueId(),
+ prepareArea.x(), prepareArea.y(), prepareArea.width(), prepareArea.height(),
+ fullArea.x(), fullArea.y(), fullArea.width(), fullArea.height());
m_surfaceBacking->prepareGL(getFirstLayer()->state(), allowZoom,
prepareArea, fullArea,
@@ -214,7 +221,11 @@ bool Surface::drawGL(bool layerTilesDisabled)
if (!getFirstLayer()->visible())
return false;
- if (!isBase()) {
+ bool isBaseLayer = isBase()
+ || getFirstLayer()->subclassType() == LayerAndroid::FixedBackgroundBaseLayer
+ || getFirstLayer()->subclassType() == LayerAndroid::ForegroundBaseLayer;
+
+ if (!isBaseLayer) {
// TODO: why are clipping regions wrong for base layer?
FloatRect drawClip = getFirstLayer()->drawClip();
FloatRect clippingRect = TilesManager::instance()->shader()->rectInScreenCoord(drawClip);
@@ -223,7 +234,8 @@ bool Surface::drawGL(bool layerTilesDisabled)
bool askRedraw = false;
if (m_surfaceBacking && !tilesDisabled) {
- ALOGV("drawGL on Surf %p with SurfBack %p", this, m_surfaceBacking);
+ ALOGV("drawGL on Surf %p with SurfBack %p, first layer %s (%d)", this, m_surfaceBacking,
+ getFirstLayer()->subclassName().ascii().data(), getFirstLayer()->uniqueId());
// TODO: why this visibleArea is different from visibleRect at zooming for base?
IntRect drawArea = visibleArea();