| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/BoxPainter.h" | 6 #include "core/paint/BoxPainter.h" |
| 7 | 7 |
| 8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.h" |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 #include "core/html/HTMLFrameOwnerElement.h" | 10 #include "core/html/HTMLFrameOwnerElement.h" |
| (...skipping 1905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1916 rectToClipOut.inflate(-1); | 1916 rectToClipOut.inflate(-1); |
| 1917 } | 1917 } |
| 1918 | 1918 |
| 1919 if (!rectToClipOut.isEmpty()) { | 1919 if (!rectToClipOut.isEmpty()) { |
| 1920 context->clipOut(rectToClipOut); | 1920 context->clipOut(rectToClipOut); |
| 1921 } | 1921 } |
| 1922 } | 1922 } |
| 1923 } | 1923 } |
| 1924 | 1924 |
| 1925 // Draw only the shadow. | 1925 // Draw only the shadow. |
| 1926 OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::cre
ate(); | 1926 context->setShadow(shadowOffset, shadowBlur, shadowColor, DrawLooper
Builder::ShadowRespectsTransforms, DrawLooperBuilder::ShadowIgnoresAlpha, DrawSh
adowOnly); |
| 1927 drawLooperBuilder->addShadow(shadowOffset, shadowBlur, shadowColor, | |
| 1928 DrawLooperBuilder::ShadowRespectsTransforms, DrawLooperBuilder::
ShadowIgnoresAlpha); | |
| 1929 context->setDrawLooper(drawLooperBuilder.release()); | |
| 1930 | 1927 |
| 1931 if (hasBorderRadius) { | 1928 if (hasBorderRadius) { |
| 1932 RoundedRect influenceRect(pixelSnappedIntRect(LayoutRect(shadowR
ect)), border.radii()); | 1929 RoundedRect influenceRect(pixelSnappedIntRect(LayoutRect(shadowR
ect)), border.radii()); |
| 1933 influenceRect.expandRadii(2 * shadowBlur + shadowSpread); | 1930 influenceRect.expandRadii(2 * shadowBlur + shadowSpread); |
| 1934 if (allCornersClippedOut(influenceRect, info.rect)) { | 1931 if (allCornersClippedOut(influenceRect, info.rect)) { |
| 1935 context->fillRect(fillRect, Color::black); | 1932 context->fillRect(fillRect, Color::black); |
| 1936 } else { | 1933 } else { |
| 1937 // TODO: support non-integer shadows - crbug.com/334829 | 1934 // TODO: support non-integer shadows - crbug.com/334829 |
| 1938 RoundedRect roundedFillRect = border; | 1935 RoundedRect roundedFillRect = border; |
| 1939 roundedFillRect.inflate(shadowSpread); | 1936 roundedFillRect.inflate(shadowSpread); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2147 | 2144 |
| 2148 FloatPoint secondQuad[4]; | 2145 FloatPoint secondQuad[4]; |
| 2149 secondQuad[0] = quad[0]; | 2146 secondQuad[0] = quad[0]; |
| 2150 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); | 2147 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); |
| 2151 secondQuad[2] = quad[2]; | 2148 secondQuad[2] = quad[2]; |
| 2152 secondQuad[3] = quad[3]; | 2149 secondQuad[3] = quad[3]; |
| 2153 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches); | 2150 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches); |
| 2154 } | 2151 } |
| 2155 | 2152 |
| 2156 } // namespace blink | 2153 } // namespace blink |
| OLD | NEW |