Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: Source/core/rendering/RenderBoxModelObject.cpp

Issue 177473003: Use SkLayerDrawLooper::Builder to construct SkLayerDrawLooper. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/rendering/InlineTextBox.cpp ('k') | Source/core/rendering/svg/SVGInlineTextBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after
2519 rectToClipOut.inflate(-1); 2519 rectToClipOut.inflate(-1);
2520 } 2520 }
2521 2521
2522 if (!rectToClipOut.isEmpty()) { 2522 if (!rectToClipOut.isEmpty()) {
2523 context->clipOut(rectToClipOut); 2523 context->clipOut(rectToClipOut);
2524 } 2524 }
2525 } 2525 }
2526 } 2526 }
2527 2527
2528 // Draw only the shadow. 2528 // Draw only the shadow.
2529 DrawLooper drawLooper; 2529 OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::cre ate();
2530 drawLooper.addShadow(shadowOffset, shadowBlur, shadowColor, 2530 drawLooperBuilder->addShadow(shadowOffset, shadowBlur, shadowColor,
2531 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresA lpha); 2531 DrawLooperBuilder::ShadowRespectsTransforms, DrawLooperBuilder:: ShadowIgnoresAlpha);
2532 context->setDrawLooper(drawLooper); 2532 context->setDrawLooper(drawLooperBuilder.release());
2533 2533
2534 if (hasBorderRadius) { 2534 if (hasBorderRadius) {
2535 RoundedRect influenceRect(pixelSnappedIntRect(LayoutRect(shadowR ect)), border.radii()); 2535 RoundedRect influenceRect(pixelSnappedIntRect(LayoutRect(shadowR ect)), border.radii());
2536 influenceRect.expandRadii(2 * shadowBlur + shadowSpread); 2536 influenceRect.expandRadii(2 * shadowBlur + shadowSpread);
2537 if (allCornersClippedOut(influenceRect, info.rect)) 2537 if (allCornersClippedOut(influenceRect, info.rect))
2538 context->fillRect(fillRect, Color::black); 2538 context->fillRect(fillRect, Color::black);
2539 else { 2539 else {
2540 // TODO: support non-integer shadows - crbug.com/334829 2540 // TODO: support non-integer shadows - crbug.com/334829
2541 RoundedRect roundedFillRect = border; 2541 RoundedRect roundedFillRect = border;
2542 roundedFillRect.inflate(shadowSpread); 2542 roundedFillRect.inflate(shadowSpread);
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
2806 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); 2806 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent());
2807 for (RenderObject* child = startChild; child && child != endChild; ) { 2807 for (RenderObject* child = startChild; child && child != endChild; ) {
2808 // Save our next sibling as moveChildTo will clear it. 2808 // Save our next sibling as moveChildTo will clear it.
2809 RenderObject* nextSibling = child->nextSibling(); 2809 RenderObject* nextSibling = child->nextSibling();
2810 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); 2810 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert);
2811 child = nextSibling; 2811 child = nextSibling;
2812 } 2812 }
2813 } 2813 }
2814 2814
2815 } // namespace WebCore 2815 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/InlineTextBox.cpp ('k') | Source/core/rendering/svg/SVGInlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698