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

Side by Side Diff: Source/core/rendering/svg/SVGInlineTextBox.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/RenderBoxModelObject.cpp ('k') | Source/platform/blink_platform.gypi » ('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) 2007 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 21 matching lines...) Expand all
32 #include "core/rendering/PointerEventsHitRules.h" 32 #include "core/rendering/PointerEventsHitRules.h"
33 #include "core/rendering/RenderTheme.h" 33 #include "core/rendering/RenderTheme.h"
34 #include "core/rendering/style/ShadowList.h" 34 #include "core/rendering/style/ShadowList.h"
35 #include "core/rendering/svg/RenderSVGInlineText.h" 35 #include "core/rendering/svg/RenderSVGInlineText.h"
36 #include "core/rendering/svg/RenderSVGResource.h" 36 #include "core/rendering/svg/RenderSVGResource.h"
37 #include "core/rendering/svg/RenderSVGResourceSolidColor.h" 37 #include "core/rendering/svg/RenderSVGResourceSolidColor.h"
38 #include "core/rendering/svg/SVGResourcesCache.h" 38 #include "core/rendering/svg/SVGResourcesCache.h"
39 #include "core/rendering/svg/SVGTextRunRenderingContext.h" 39 #include "core/rendering/svg/SVGTextRunRenderingContext.h"
40 #include "platform/FloatConversion.h" 40 #include "platform/FloatConversion.h"
41 #include "platform/fonts/FontCache.h" 41 #include "platform/fonts/FontCache.h"
42 #include "platform/graphics/DrawLooper.h" 42 #include "platform/graphics/DrawLooperBuilder.h"
43 #include "platform/graphics/GraphicsContextStateSaver.h" 43 #include "platform/graphics/GraphicsContextStateSaver.h"
44 44
45 using namespace std; 45 using namespace std;
46 46
47 namespace WebCore { 47 namespace WebCore {
48 48
49 struct ExpectedSVGInlineTextBoxSize : public InlineTextBox { 49 struct ExpectedSVGInlineTextBoxSize : public InlineTextBox {
50 float float1; 50 float float1;
51 uint32_t bitfields : 5; 51 uint32_t bitfields : 5;
52 void* pointer; 52 void* pointer;
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 FloatSize textSize(fragment.width, fragment.height); 616 FloatSize textSize(fragment.width, fragment.height);
617 617
618 if (scalingFactor != 1) { 618 if (scalingFactor != 1) {
619 textOrigin.scale(scalingFactor, scalingFactor); 619 textOrigin.scale(scalingFactor, scalingFactor);
620 textSize.scale(scalingFactor); 620 textSize.scale(scalingFactor);
621 context->save(); 621 context->save();
622 context->scale(FloatSize(1 / scalingFactor, 1 / scalingFactor)); 622 context->scale(FloatSize(1 / scalingFactor, 1 / scalingFactor));
623 } 623 }
624 624
625 if (hasShadow) { 625 if (hasShadow) {
626 DrawLooper drawLooper; 626 OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create( );
627 for (size_t i = shadowList->shadows().size(); i--; ) { 627 for (size_t i = shadowList->shadows().size(); i--; ) {
628 const ShadowData& shadow = shadowList->shadows()[i]; 628 const ShadowData& shadow = shadowList->shadows()[i];
629 FloatSize offset(shadow.x(), shadow.y()); 629 FloatSize offset(shadow.x(), shadow.y());
630 drawLooper.addShadow(offset, shadow.blur(), shadow.color(), 630 drawLooperBuilder->addShadow(offset, shadow.blur(), shadow.color(),
631 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowRespects Alpha); 631 DrawLooperBuilder::ShadowRespectsTransforms, DrawLooperBuilder:: ShadowRespectsAlpha);
632 } 632 }
633 drawLooper.addUnmodifiedContent(); 633 drawLooperBuilder->addUnmodifiedContent();
634 context->setDrawLooper(drawLooper); 634 context->setDrawLooper(drawLooperBuilder.release());
635 } 635 }
636 636
637 if (prepareGraphicsContextForTextPainting(context, scalingFactor, textRun, s tyle)) { 637 if (prepareGraphicsContextForTextPainting(context, scalingFactor, textRun, s tyle)) {
638 TextRunPaintInfo textRunPaintInfo(textRun); 638 TextRunPaintInfo textRunPaintInfo(textRun);
639 textRunPaintInfo.from = startPosition; 639 textRunPaintInfo.from = startPosition;
640 textRunPaintInfo.to = endPosition; 640 textRunPaintInfo.to = endPosition;
641 textRunPaintInfo.bounds = FloatRect(textOrigin, textSize); 641 textRunPaintInfo.bounds = FloatRect(textOrigin, textSize);
642 scaledFont.drawText(context, textRunPaintInfo, textOrigin); 642 scaledFont.drawText(context, textRunPaintInfo, textOrigin);
643 restoreGraphicsContextAfterTextPainting(context, textRun); 643 restoreGraphicsContextAfterTextPainting(context, textRun);
644 } 644 }
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 renderer().updateHitTestResult(result, locationInContainer.point () - toLayoutSize(accumulatedOffset)); 790 renderer().updateHitTestResult(result, locationInContainer.point () - toLayoutSize(accumulatedOffset));
791 if (!result.addNodeToRectBasedTestResult(renderer().node(), requ est, locationInContainer, rect)) 791 if (!result.addNodeToRectBasedTestResult(renderer().node(), requ est, locationInContainer, rect))
792 return true; 792 return true;
793 } 793 }
794 } 794 }
795 } 795 }
796 return false; 796 return false;
797 } 797 }
798 798
799 } // namespace WebCore 799 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBoxModelObject.cpp ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698