OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "core/rendering/RenderFlowThread.h" | 35 #include "core/rendering/RenderFlowThread.h" |
36 #include "core/rendering/RenderGeometryMap.h" | 36 #include "core/rendering/RenderGeometryMap.h" |
37 #include "core/rendering/RenderInline.h" | 37 #include "core/rendering/RenderInline.h" |
38 #include "core/rendering/RenderLayer.h" | 38 #include "core/rendering/RenderLayer.h" |
39 #include "core/rendering/RenderRegion.h" | 39 #include "core/rendering/RenderRegion.h" |
40 #include "core/rendering/RenderView.h" | 40 #include "core/rendering/RenderView.h" |
41 #include "core/rendering/compositing/CompositedLayerMapping.h" | 41 #include "core/rendering/compositing/CompositedLayerMapping.h" |
42 #include "core/rendering/compositing/RenderLayerCompositor.h" | 42 #include "core/rendering/compositing/RenderLayerCompositor.h" |
43 #include "core/rendering/style/ShadowList.h" | 43 #include "core/rendering/style/ShadowList.h" |
44 #include "platform/geometry/TransformState.h" | 44 #include "platform/geometry/TransformState.h" |
45 #include "platform/graphics/DrawLooper.h" | 45 #include "platform/graphics/DrawLooperBuilder.h" |
46 #include "platform/graphics/GraphicsContextStateSaver.h" | 46 #include "platform/graphics/GraphicsContextStateSaver.h" |
47 #include "platform/graphics/Path.h" | 47 #include "platform/graphics/Path.h" |
48 #include "wtf/CurrentTime.h" | 48 #include "wtf/CurrentTime.h" |
49 | 49 |
50 using namespace std; | 50 using namespace std; |
51 | 51 |
52 namespace WebCore { | 52 namespace WebCore { |
53 | 53 |
54 using namespace HTMLNames; | 54 using namespace HTMLNames; |
55 | 55 |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 static void applyBoxShadowForBackground(GraphicsContext* context, const RenderOb
ject* renderer) | 470 static void applyBoxShadowForBackground(GraphicsContext* context, const RenderOb
ject* renderer) |
471 { | 471 { |
472 const ShadowList* shadowList = renderer->style()->boxShadow(); | 472 const ShadowList* shadowList = renderer->style()->boxShadow(); |
473 ASSERT(shadowList); | 473 ASSERT(shadowList); |
474 for (size_t i = shadowList->shadows().size(); i--; ) { | 474 for (size_t i = shadowList->shadows().size(); i--; ) { |
475 const ShadowData& boxShadow = shadowList->shadows()[i]; | 475 const ShadowData& boxShadow = shadowList->shadows()[i]; |
476 if (boxShadow.style() != Normal) | 476 if (boxShadow.style() != Normal) |
477 continue; | 477 continue; |
478 FloatSize shadowOffset(boxShadow.x(), boxShadow.y()); | 478 FloatSize shadowOffset(boxShadow.x(), boxShadow.y()); |
479 context->setShadow(shadowOffset, boxShadow.blur(), boxShadow.color(), | 479 context->setShadow(shadowOffset, boxShadow.blur(), boxShadow.color(), |
480 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresAlpha
); | 480 DrawLooperBuilder::ShadowRespectsTransforms, DrawLooperBuilder::Shad
owIgnoresAlpha); |
481 return; | 481 return; |
482 } | 482 } |
483 } | 483 } |
484 | 484 |
485 void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
nst Color& color, const FillLayer* bgLayer, const LayoutRect& rect, | 485 void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
nst Color& color, const FillLayer* bgLayer, const LayoutRect& rect, |
486 BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox* box, const LayoutSiz
e& boxSize, CompositeOperator op, RenderObject* backgroundObject) | 486 BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox* box, const LayoutSiz
e& boxSize, CompositeOperator op, RenderObject* backgroundObject) |
487 { | 487 { |
488 GraphicsContext* context = paintInfo.context; | 488 GraphicsContext* context = paintInfo.context; |
489 if (context->paintingDisabled() || rect.isEmpty()) | 489 if (context->paintingDisabled() || rect.isEmpty()) |
490 return; | 490 return; |
(...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2505 rectToClipOut.inflate(-1); | 2505 rectToClipOut.inflate(-1); |
2506 } | 2506 } |
2507 | 2507 |
2508 if (!rectToClipOut.isEmpty()) { | 2508 if (!rectToClipOut.isEmpty()) { |
2509 context->clipOut(rectToClipOut); | 2509 context->clipOut(rectToClipOut); |
2510 } | 2510 } |
2511 } | 2511 } |
2512 } | 2512 } |
2513 | 2513 |
2514 // Draw only the shadow. | 2514 // Draw only the shadow. |
2515 DrawLooper drawLooper; | 2515 OwnPtr<DrawLooperBuilder> drawLooperBuilder = adoptPtr(new DrawLoope
rBuilder); |
2516 drawLooper.addShadow(shadowOffset, shadowBlur, shadowColor, | 2516 drawLooperBuilder->addShadow(shadowOffset, shadowBlur, shadowColor, |
2517 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresA
lpha); | 2517 DrawLooperBuilder::ShadowRespectsTransforms, DrawLooperBuilder::
ShadowIgnoresAlpha); |
2518 context->setDrawLooper(drawLooper); | 2518 context->setDrawLooper(drawLooperBuilder.release()); |
2519 | 2519 |
2520 if (hasBorderRadius) { | 2520 if (hasBorderRadius) { |
2521 RoundedRect influenceRect(pixelSnappedIntRect(LayoutRect(shadowR
ect)), border.radii()); | 2521 RoundedRect influenceRect(pixelSnappedIntRect(LayoutRect(shadowR
ect)), border.radii()); |
2522 influenceRect.expandRadii(2 * shadowBlur + shadowSpread); | 2522 influenceRect.expandRadii(2 * shadowBlur + shadowSpread); |
2523 if (allCornersClippedOut(influenceRect, info.rect)) | 2523 if (allCornersClippedOut(influenceRect, info.rect)) |
2524 context->fillRect(fillRect, Color::black); | 2524 context->fillRect(fillRect, Color::black); |
2525 else { | 2525 else { |
2526 // TODO: support non-integer shadows - crbug.com/334829 | 2526 // TODO: support non-integer shadows - crbug.com/334829 |
2527 RoundedRect roundedFillRect = border; | 2527 RoundedRect roundedFillRect = border; |
2528 roundedFillRect.inflate(shadowSpread); | 2528 roundedFillRect.inflate(shadowSpread); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2792 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 2792 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
2793 for (RenderObject* child = startChild; child && child != endChild; ) { | 2793 for (RenderObject* child = startChild; child && child != endChild; ) { |
2794 // Save our next sibling as moveChildTo will clear it. | 2794 // Save our next sibling as moveChildTo will clear it. |
2795 RenderObject* nextSibling = child->nextSibling(); | 2795 RenderObject* nextSibling = child->nextSibling(); |
2796 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); | 2796 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
2797 child = nextSibling; | 2797 child = nextSibling; |
2798 } | 2798 } |
2799 } | 2799 } |
2800 | 2800 |
2801 } // namespace WebCore | 2801 } // namespace WebCore |
OLD | NEW |