|
Lines 554-560
void RenderLayer::updateTransform()
Source/WebCore/rendering/RenderLayer.cpp_sec1
|
| 554 |
RenderBox* box = renderBox(); |
554 |
RenderBox* box = renderBox(); |
| 555 |
ASSERT(box); |
555 |
ASSERT(box); |
| 556 |
m_transform->makeIdentity(); |
556 |
m_transform->makeIdentity(); |
| 557 |
box->style()->applyTransform(*m_transform, box->borderBoxRect().size(), RenderStyle::IncludeTransformOrigin); |
557 |
box->style()->applyTransform(*m_transform, box->pixelSnappedBorderBoxRect().size(), RenderStyle::IncludeTransformOrigin); |
| 558 |
makeMatrixRenderable(*m_transform, canRender3DTransforms()); |
558 |
makeMatrixRenderable(*m_transform, canRender3DTransforms()); |
| 559 |
} |
559 |
} |
| 560 |
|
560 |
|
|
Lines 571-577
TransformationMatrix RenderLayer::curren
Source/WebCore/rendering/RenderLayer.cpp_sec2
|
| 571 |
if (renderer()->style()->isRunningAcceleratedAnimation()) { |
571 |
if (renderer()->style()->isRunningAcceleratedAnimation()) { |
| 572 |
TransformationMatrix currTransform; |
572 |
TransformationMatrix currTransform; |
| 573 |
RefPtr<RenderStyle> style = renderer()->animation()->getAnimatedStyleForRenderer(renderer()); |
573 |
RefPtr<RenderStyle> style = renderer()->animation()->getAnimatedStyleForRenderer(renderer()); |
| 574 |
style->applyTransform(currTransform, renderBox()->borderBoxRect().size(), RenderStyle::IncludeTransformOrigin); |
574 |
style->applyTransform(currTransform, renderBox()->pixelSnappedBorderBoxRect().size(), RenderStyle::IncludeTransformOrigin); |
| 575 |
makeMatrixRenderable(currTransform, canRender3DTransforms()); |
575 |
makeMatrixRenderable(currTransform, canRender3DTransforms()); |
| 576 |
return currTransform; |
576 |
return currTransform; |
| 577 |
} |
577 |
} |
|
Lines 879-885
TransformationMatrix RenderLayer::perspe
Source/WebCore/rendering/RenderLayer.cpp_sec3
|
| 879 |
return TransformationMatrix(); |
879 |
return TransformationMatrix(); |
| 880 |
|
880 |
|
| 881 |
// Maybe fetch the perspective from the backing? |
881 |
// Maybe fetch the perspective from the backing? |
| 882 |
const LayoutRect borderBox = toRenderBox(renderer())->borderBoxRect(); |
882 |
const IntRect borderBox = toRenderBox(renderer())->pixelSnappedBorderBoxRect(); |
| 883 |
const float boxWidth = borderBox.width(); |
883 |
const float boxWidth = borderBox.width(); |
| 884 |
const float boxHeight = borderBox.height(); |
884 |
const float boxHeight = borderBox.height(); |
| 885 |
|
885 |
|
|
Lines 2841-2847
bool RenderLayer::scroll(ScrollDirection
Source/WebCore/rendering/RenderLayer.cpp_sec4
|
| 2841 |
void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject* paintingRoot, RenderRegion* region, PaintLayerFlags paintFlags) |
2841 |
void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject* paintingRoot, RenderRegion* region, PaintLayerFlags paintFlags) |
| 2842 |
{ |
2842 |
{ |
| 2843 |
OverlapTestRequestMap overlapTestRequests; |
2843 |
OverlapTestRequestMap overlapTestRequests; |
| 2844 |
paintLayer(this, context, damageRect, paintBehavior, paintingRoot, region, &overlapTestRequests, paintFlags); |
2844 |
paintLayer(this, context, enclosingIntRect(damageRect), LayoutSize(), paintBehavior, paintingRoot, region, &overlapTestRequests, paintFlags); |
| 2845 |
OverlapTestRequestMap::iterator end = overlapTestRequests.end(); |
2845 |
OverlapTestRequestMap::iterator end = overlapTestRequests.end(); |
| 2846 |
for (OverlapTestRequestMap::iterator it = overlapTestRequests.begin(); it != end; ++it) |
2846 |
for (OverlapTestRequestMap::iterator it = overlapTestRequests.begin(); it != end; ++it) |
| 2847 |
it->first->setOverlapTestResult(false); |
2847 |
it->first->setOverlapTestResult(false); |
|
Lines 2851-2857
void RenderLayer::paintOverlayScrollbars
Source/WebCore/rendering/RenderLayer.cpp_sec5
|
| 2851 |
{ |
2851 |
{ |
| 2852 |
if (!m_containsDirtyOverlayScrollbars) |
2852 |
if (!m_containsDirtyOverlayScrollbars) |
| 2853 |
return; |
2853 |
return; |
| 2854 |
paintLayer(this, context, damageRect, paintBehavior, paintingRoot, 0, 0, PaintLayerHaveTransparency | PaintLayerTemporaryClipRects |
2854 |
paintLayer(this, context, damageRect, LayoutSize(), paintBehavior, paintingRoot, 0, 0, PaintLayerHaveTransparency | PaintLayerTemporaryClipRects |
| 2855 |
| PaintLayerPaintingOverlayScrollbars); |
2855 |
| PaintLayerPaintingOverlayScrollbars); |
| 2856 |
m_containsDirtyOverlayScrollbars = false; |
2856 |
m_containsDirtyOverlayScrollbars = false; |
| 2857 |
} |
2857 |
} |
|
Lines 2948-2954
static inline bool shouldSuppressPaintin
Source/WebCore/rendering/RenderLayer.cpp_sec6
|
| 2948 |
|
2948 |
|
| 2949 |
|
2949 |
|
| 2950 |
void RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* context, |
2950 |
void RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* context, |
| 2951 |
const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior, |
2951 |
const LayoutRect& paintDirtyRect, const LayoutSize& subPixelAccumulation, PaintBehavior paintBehavior, |
| 2952 |
RenderObject* paintingRoot, RenderRegion* region, OverlapTestRequestMap* overlapTestRequests, |
2952 |
RenderObject* paintingRoot, RenderRegion* region, OverlapTestRequestMap* overlapTestRequests, |
| 2953 |
PaintLayerFlags paintFlags) |
2953 |
PaintLayerFlags paintFlags) |
| 2954 |
{ |
2954 |
{ |
|
Lines 3006-3016
void RenderLayer::paintLayer(RenderLayer
Source/WebCore/rendering/RenderLayer.cpp_sec7
|
| 3006 |
} |
3006 |
} |
| 3007 |
|
3007 |
|
| 3008 |
// Adjust the transform such that the renderer's upper left corner will paint at (0,0) in user space. |
3008 |
// Adjust the transform such that the renderer's upper left corner will paint at (0,0) in user space. |
| 3009 |
// This involves subtracting out the position of the layer in our current coordinate space. |
3009 |
// This involves subtracting out the position of the layer in our current coordinate space, but preserving |
|
|
3010 |
// the accumulated error for sub-pixel layout. |
| 3010 |
LayoutPoint delta; |
3011 |
LayoutPoint delta; |
| 3011 |
convertToLayerCoords(rootLayer, delta); |
3012 |
convertToLayerCoords(rootLayer, delta); |
| 3012 |
TransformationMatrix transform(layerTransform); |
3013 |
TransformationMatrix transform(layerTransform); |
| 3013 |
transform.translateRight(delta.x(), delta.y()); |
3014 |
IntPoint roundedDelta = roundedIntPoint(delta); |
|
|
3015 |
transform.translateRight(roundedDelta.x(), roundedDelta.y()); |
| 3016 |
LayoutSize adjustedSubPixelAccumulation = subPixelAccumulation + (delta - roundedDelta); |
| 3014 |
|
3017 |
|
| 3015 |
// Apply the transform. |
3018 |
// Apply the transform. |
| 3016 |
{ |
3019 |
{ |
|
Lines 3018-3024
void RenderLayer::paintLayer(RenderLayer
Source/WebCore/rendering/RenderLayer.cpp_sec8
|
| 3018 |
context->concatCTM(transform.toAffineTransform()); |
3021 |
context->concatCTM(transform.toAffineTransform()); |
| 3019 |
|
3022 |
|
| 3020 |
// Now do a paint with the root layer shifted to be us. |
3023 |
// Now do a paint with the root layer shifted to be us. |
| 3021 |
paintLayerContentsAndReflection(this, context, transform.inverse().mapRect(paintDirtyRect), paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags); |
3024 |
paintLayerContentsAndReflection(this, context, enclosingIntRect(transform.inverse().mapRect(paintDirtyRect)), adjustedSubPixelAccumulation, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags); |
| 3022 |
} |
3025 |
} |
| 3023 |
|
3026 |
|
| 3024 |
// Restore the clip. |
3027 |
// Restore the clip. |
|
Lines 3028-3038
void RenderLayer::paintLayer(RenderLayer
Source/WebCore/rendering/RenderLayer.cpp_sec9
|
| 3028 |
return; |
3031 |
return; |
| 3029 |
} |
3032 |
} |
| 3030 |
|
3033 |
|
| 3031 |
paintLayerContentsAndReflection(rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags); |
3034 |
paintLayerContentsAndReflection(rootLayer, context, paintDirtyRect, subPixelAccumulation, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags); |
| 3032 |
} |
3035 |
} |
| 3033 |
|
3036 |
|
| 3034 |
void RenderLayer::paintLayerContentsAndReflection(RenderLayer* rootLayer, GraphicsContext* context, |
3037 |
void RenderLayer::paintLayerContentsAndReflection(RenderLayer* rootLayer, GraphicsContext* context, |
| 3035 |
const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior, |
3038 |
const LayoutRect& paintDirtyRect, const LayoutSize& subPixelAccumulation, PaintBehavior paintBehavior, |
| 3036 |
RenderObject* paintingRoot, RenderRegion* region, OverlapTestRequestMap* overlapTestRequests, |
3039 |
RenderObject* paintingRoot, RenderRegion* region, OverlapTestRequestMap* overlapTestRequests, |
| 3037 |
PaintLayerFlags paintFlags) |
3040 |
PaintLayerFlags paintFlags) |
| 3038 |
{ |
3041 |
{ |
|
Lines 3044-3059
void RenderLayer::paintLayerContentsAndR
Source/WebCore/rendering/RenderLayer.cpp_sec10
|
| 3044 |
if (m_reflection && !m_paintingInsideReflection) { |
3047 |
if (m_reflection && !m_paintingInsideReflection) { |
| 3045 |
// Mark that we are now inside replica painting. |
3048 |
// Mark that we are now inside replica painting. |
| 3046 |
m_paintingInsideReflection = true; |
3049 |
m_paintingInsideReflection = true; |
| 3047 |
reflectionLayer()->paintLayer(rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, localPaintFlags | PaintLayerPaintingReflection); |
3050 |
reflectionLayer()->paintLayer(rootLayer, context, paintDirtyRect, subPixelAccumulation, paintBehavior, paintingRoot, region, overlapTestRequests, localPaintFlags | PaintLayerPaintingReflection); |
| 3048 |
m_paintingInsideReflection = false; |
3051 |
m_paintingInsideReflection = false; |
| 3049 |
} |
3052 |
} |
| 3050 |
|
3053 |
|
| 3051 |
localPaintFlags |= PaintLayerPaintingCompositingAllPhases; |
3054 |
localPaintFlags |= PaintLayerPaintingCompositingAllPhases; |
| 3052 |
paintLayerContents(rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, localPaintFlags); |
3055 |
paintLayerContents(rootLayer, context, paintDirtyRect, subPixelAccumulation, paintBehavior, paintingRoot, region, overlapTestRequests, localPaintFlags); |
| 3053 |
} |
3056 |
} |
| 3054 |
|
3057 |
|
| 3055 |
void RenderLayer::paintLayerContents(RenderLayer* rootLayer, GraphicsContext* context, |
3058 |
void RenderLayer::paintLayerContents(RenderLayer* rootLayer, GraphicsContext* context, |
| 3056 |
const LayoutRect& parentPaintDirtyRect, PaintBehavior paintBehavior, |
3059 |
const LayoutRect& parentPaintDirtyRect, const LayoutSize& subPixelAccumulation, PaintBehavior paintBehavior, |
| 3057 |
RenderObject* paintingRoot, RenderRegion* region, OverlapTestRequestMap* overlapTestRequests, |
3060 |
RenderObject* paintingRoot, RenderRegion* region, OverlapTestRequestMap* overlapTestRequests, |
| 3058 |
PaintLayerFlags paintFlags) |
3061 |
PaintLayerFlags paintFlags) |
| 3059 |
{ |
3062 |
{ |
|
Lines 3112-3118
void RenderLayer::paintLayerContents(Ren
Source/WebCore/rendering/RenderLayer.cpp_sec11
|
| 3112 |
|
3115 |
|
| 3113 |
if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars) { |
3116 |
if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars) { |
| 3114 |
calculateRects(rootLayer, region, (localPaintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect); |
3117 |
calculateRects(rootLayer, region, (localPaintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect); |
| 3115 |
paintOffset = toPoint(layerBounds.location() - renderBoxLocation()); |
3118 |
paintOffset = toPoint(layerBounds.location() - renderBoxLocation() + subPixelAccumulation); |
| 3116 |
} |
3119 |
} |
| 3117 |
|
3120 |
|
| 3118 |
bool forceBlackText = paintBehavior & PaintBehaviorForceBlackText; |
3121 |
bool forceBlackText = paintBehavior & PaintBehaviorForceBlackText; |
|
Lines 3263-3269
void RenderLayer::paintList(Vector<Rende
Source/WebCore/rendering/RenderLayer.cpp_sec12
|
| 3263 |
for (size_t i = 0; i < list->size(); ++i) { |
3266 |
for (size_t i = 0; i < list->size(); ++i) { |
| 3264 |
RenderLayer* childLayer = list->at(i); |
3267 |
RenderLayer* childLayer = list->at(i); |
| 3265 |
if (!childLayer->isPaginated()) |
3268 |
if (!childLayer->isPaginated()) |
| 3266 |
childLayer->paintLayer(rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags); |
3269 |
childLayer->paintLayer(rootLayer, context, paintDirtyRect, LayoutSize(), paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags); |
| 3267 |
else |
3270 |
else |
| 3268 |
paintPaginatedChildLayer(childLayer, rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags); |
3271 |
paintPaginatedChildLayer(childLayer, rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags); |
| 3269 |
} |
3272 |
} |
|
Lines 3354-3360
void RenderLayer::paintChildLayerIntoCol
Source/WebCore/rendering/RenderLayer.cpp_sec13
|
| 3354 |
newTransform.translateRight(roundToInt(offset.width()), roundToInt(offset.height())); |
3357 |
newTransform.translateRight(roundToInt(offset.width()), roundToInt(offset.height())); |
| 3355 |
|
3358 |
|
| 3356 |
childLayer->m_transform = adoptPtr(new TransformationMatrix(newTransform)); |
3359 |
childLayer->m_transform = adoptPtr(new TransformationMatrix(newTransform)); |
| 3357 |
childLayer->paintLayer(rootLayer, context, localDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags); |
3360 |
childLayer->paintLayer(rootLayer, context, localDirtyRect, LayoutSize(), paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags); |
| 3358 |
if (oldHasTransform) |
3361 |
if (oldHasTransform) |
| 3359 |
childLayer->m_transform = adoptPtr(new TransformationMatrix(oldTransform)); |
3362 |
childLayer->m_transform = adoptPtr(new TransformationMatrix(oldTransform)); |
| 3360 |
else |
3363 |
else |
|
Lines 3950-3956
void RenderLayer::calculateClipRects(con
Source/WebCore/rendering/RenderLayer.cpp_sec14
|
| 3950 |
// some transformed layer boundary, for example, in the RenderLayerCompositor overlapMap, where |
3953 |
// some transformed layer boundary, for example, in the RenderLayerCompositor overlapMap, where |
| 3951 |
// clipRects are needed in view space. |
3954 |
// clipRects are needed in view space. |
| 3952 |
LayoutPoint offset; |
3955 |
LayoutPoint offset; |
| 3953 |
offset = roundedIntPoint(renderer()->localToContainerPoint(FloatPoint(), rootLayer->renderer())); |
3956 |
offset = roundedLayoutPoint(renderer()->localToContainerPoint(FloatPoint(), rootLayer->renderer(), true, false, 0)); |
| 3954 |
RenderView* view = renderer()->view(); |
3957 |
RenderView* view = renderer()->view(); |
| 3955 |
ASSERT(view); |
3958 |
ASSERT(view); |
| 3956 |
if (view && clipRects.fixed() && rootLayer->renderer() == view) { |
3959 |
if (view && clipRects.fixed() && rootLayer->renderer() == view) { |
|
Lines 4058-4064
void RenderLayer::calculateRects(const R
Source/WebCore/rendering/RenderLayer.cpp_sec15
|
| 4058 |
backgroundRect.intersect(layerBoundsWithVisualOverflow); |
4061 |
backgroundRect.intersect(layerBoundsWithVisualOverflow); |
| 4059 |
} else { |
4062 |
} else { |
| 4060 |
// Shift the bounds to be for our region only. |
4063 |
// Shift the bounds to be for our region only. |
| 4061 |
LayoutRect bounds = pixelSnappedIntRect(renderBox()->borderBoxRectInRegion(region)); |
4064 |
LayoutRect bounds = renderBox()->borderBoxRectInRegion(region); |
| 4062 |
bounds.moveBy(offset); |
4065 |
bounds.moveBy(offset); |
| 4063 |
backgroundRect.intersect(bounds); |
4066 |
backgroundRect.intersect(bounds); |
| 4064 |
} |
4067 |
} |