1. 05 Apr, 2013 1 commit
    • kangil.han@samsung.com's avatar
      Prefer prefix ++/-- operators for non-primitive types · d97b4ea1
      kangil.han@samsung.com authored
      https://bugs.webkit.org/show_bug.cgi?id=114033
      
      Reviewed by Alexey Proskuryakov.
      
      Post ++/-- creates a copy of current value and it is not necessary, so use prefix instead.
      
      * bindings/js/Dictionary.cpp:
      (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
      (WebCore::Dictionary::getOwnPropertyNames):
      * bindings/js/ScriptCallStackFactory.cpp:
      (WebCore::createScriptCallStack):
      * dom/ContainerNode.cpp:
      (WebCore::willRemoveChildren):
      * dom/Range.cpp:
      (WebCore::Range::processAncestorsAndTheirSiblings):
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::detachChildren):
      * platform/graphics/gpu/LoopBlinnPathProcessor.cpp:
      (WebCore):
      (WebCore::LoopBlinnPathProcessor::subdivideCurvesSlow):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paintDocumentMarkers):
      * xml/XPathFunctions.cpp:
      (WebCore::XPath::Function::setArguments):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d97b4ea1
  2. 11 Sep, 2012 1 commit
    • commit-queue@webkit.org's avatar
      Deploy StringBuilder::appendNumber() and StringBuilder::appendLiteral() in more places · 2e53009b
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=96344
      
      Patch by Jinwoo Song <jinwoo7.song@samsung.com> on 2012-09-11
      Reviewed by Benjamin Poulain.
      
      Use StringBuilder::appendNumber() instead of String::number(). Also deploy
      StringBuilder::appendLiteral() instead of String::append() in the surrounding code.
      
      Source/WebCore:
      
      * css/CSSAspectRatioValue.cpp:
      (WebCore::CSSAspectRatioValue::customCssText):
      * platform/graphics/gpu/LoopBlinnPathProcessor.cpp:
      (WebCore):
      * svg/SVGPointList.cpp:
      (WebCore::SVGPointList::valueAsString):
      
      Source/WebKit/blackberry:
      
      * WebCoreSupport/DatePickerClient.cpp:
      (WebCore::DatePickerClient::generateHTML):
      * WebCoreSupport/SelectPopupClient.cpp:
      (WebCore::SelectPopupClient::generateHTML):
      
      Source/WebKit2:
      
      * Shared/WebMemorySampler.cpp:
      (WebKit::WebMemorySampler::appendCurrentMemoryUsageToFile):
      * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
      (WebKit::WebSocketServerConnection::sendHTTPResponseHeader):
      * UIProcess/InspectorServer/qt/WebInspectorServerQt.cpp:
      (WebKit::WebInspectorServer::inspectorUrlForPageID):
      (WebKit::WebInspectorServer::buildPageList):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2e53009b
  3. 30 Jul, 2012 1 commit
    • eric@webkit.org's avatar
      Grid Demo spends 1.5% of total time allocating Path objects in... · ee9e9d9e
      eric@webkit.org authored
      Grid Demo spends 1.5% of total time allocating Path objects in RenderBoxModelObject::paintBorderSides
      https://bugs.webkit.org/show_bug.cgi?id=92252
      
      Reviewed by Simon Fraser.
      
      This change introduces the concept of a "null Path" very similar to a null WTF::String.
      Just like String functions as a RefPtr around a StringImpl, Path (for most ports)
      functions as an OwnPtr around a PlatformPathPtr.
      
      In various places in the code, we declare a local Path variable, but don't necessarily
      use that Path variable in all code paths, or might pass that Path variable along to GraphicsContext
      functions, without ever actually adding points to that Path.
      On most platforms, this Path default constructor was causing a malloc!
      In some of these case, the code-path in question (like paintBorderSides) can be quite hot.
      Introducing this null-Path and delaying instantiation of the PlatformPath object
      until it's actually needed, saves a malloc for these hot paths.
      
      To test this, I loaded a few popular pages, and added printfs to both the Path constructor
      and destructor, logging during construction and destruction when the path was still null at destruction time.
      
      This simple testing showed this to be a small win (avoiding mallocs) on many sites and a huge win for Google Spreadsheets:
      apple.com: 147 Paths created, 9 (6%) destroyed null.
      google.com: 58 Paths created, 26 (44%) destroyed null (google seems creating 5 paths every second after load?  1 of which is destroyed empty.)
      amazon.com: 130 Paths created, 130 (100%) destroyed null.
      Loading an empty spreadsheet from drive.google.com: 5237 created, 4861 destroyed null (92%!) :)
      
      * platform/graphics/Path.h:
      (Path):
      (WebCore::Path::isNull):
      (WebCore::Path::ensurePlatformPath):
      * platform/graphics/cairo/CairoUtilities.cpp:
      (WebCore::appendWebCorePathToCairoContext):
      * platform/graphics/cairo/GraphicsContextCairo.cpp:
      (WebCore::GraphicsContext::fillPath):
      (WebCore::GraphicsContext::strokePath):
      (WebCore::GraphicsContext::clipPath):
      (WebCore::GraphicsContext::clip):
      * platform/graphics/cairo/PathCairo.cpp:
      (WebCore::Path::Path):
      (WebCore::Path::~Path):
      (WebCore::Path::ensurePlatformPath):
      (WebCore):
      (WebCore::Path::operator=):
      (WebCore::Path::clear):
      (WebCore::Path::isEmpty):
      (WebCore::Path::currentPoint):
      (WebCore::Path::translate):
      (WebCore::Path::moveTo):
      (WebCore::Path::addLineTo):
      (WebCore::Path::addRect):
      (WebCore::Path::addQuadCurveTo):
      (WebCore::Path::addBezierCurveTo):
      (WebCore::Path::addArc):
      (WebCore::Path::addArcTo):
      (WebCore::Path::addEllipse):
      (WebCore::Path::closeSubpath):
      (WebCore::Path::boundingRect):
      (WebCore::Path::strokeBoundingRect):
      (WebCore::Path::contains):
      (WebCore::Path::strokeContains):
      (WebCore::Path::apply):
      (WebCore::Path::transform):
      * platform/graphics/cg/GraphicsContextCG.cpp:
      (WebCore::GraphicsContext::drawPath):
      (WebCore::GraphicsContext::fillPath):
      (WebCore::GraphicsContext::strokePath):
      (WebCore::GraphicsContext::clipPath):
      (WebCore::GraphicsContext::clipOut):
      * platform/graphics/cg/PathCG.cpp:
      (WebCore::Path::Path):
      (WebCore::Path::~Path):
      (WebCore):
      (WebCore::Path::ensurePlatformPath):
      (WebCore::Path::operator=):
      (WebCore::Path::contains):
      (WebCore::Path::strokeContains):
      (WebCore::Path::translate):
      (WebCore::Path::boundingRect):
      (WebCore::Path::fastBoundingRect):
      (WebCore::Path::strokeBoundingRect):
      (WebCore::Path::moveTo):
      (WebCore::Path::addLineTo):
      (WebCore::Path::addQuadCurveTo):
      (WebCore::Path::addBezierCurveTo):
      (WebCore::Path::addArcTo):
      (WebCore::Path::platformAddPathForRoundedRect):
      (WebCore::Path::closeSubpath):
      (WebCore::Path::addArc):
      (WebCore::Path::addRect):
      (WebCore::Path::addEllipse):
      (WebCore::Path::clear):
      (WebCore::Path::isEmpty):
      (WebCore::Path::currentPoint):
      (WebCore::Path::apply):
      * platform/graphics/gpu/LoopBlinnPathProcessor.cpp:
      (WebCore):
      (WebCore::LoopBlinnPathProcessor::buildContours):
      * platform/graphics/mac/GraphicsContextMac.mm:
      (WebCore::GraphicsContext::drawFocusRing):
      * platform/graphics/openvg/PainterOpenVG.cpp:
      (WebCore::PainterOpenVG::drawPath):
      * platform/graphics/skia/GraphicsContextSkia.cpp:
      (WebCore::GraphicsContext::clip):
      (WebCore::GraphicsContext::canvasClip):
      (WebCore::GraphicsContext::clipOut):
      (WebCore::GraphicsContext::clipPath):
      (WebCore::GraphicsContext::fillPath):
      (WebCore::GraphicsContext::strokePath):
      * platform/graphics/skia/PathSkia.cpp:
      (WebCore::Path::Path):
      (WebCore::Path::~Path):
      (WebCore):
      (WebCore::Path::ensurePlatformPath):
      (WebCore::Path::operator=):
      (WebCore::Path::isEmpty):
      (WebCore::Path::hasCurrentPoint):
      (WebCore::Path::currentPoint):
      (WebCore::Path::contains):
      (WebCore::Path::translate):
      (WebCore::Path::boundingRect):
      (WebCore::Path::moveTo):
      (WebCore::Path::addLineTo):
      (WebCore::Path::addQuadCurveTo):
      (WebCore::Path::addBezierCurveTo):
      (WebCore::Path::addArcTo):
      (WebCore::Path::closeSubpath):
      (WebCore::Path::addArc):
      (WebCore::Path::addRect):
      (WebCore::Path::addEllipse):
      (WebCore::Path::clear):
      (WebCore::Path::apply):
      (WebCore::Path::transform):
      (WebCore::Path::strokeBoundingRect):
      (WebCore::Path::strokeContains):
      * platform/graphics/wince/GraphicsContextWinCE.cpp:
      (WebCore::GraphicsContext::fillPath):
      (WebCore::GraphicsContext::strokePath):
      * platform/graphics/wx/GraphicsContextWx.cpp:
      (WebCore::GraphicsContext::clipPath):
      (WebCore::GraphicsContext::fillPath):
      (WebCore::GraphicsContext::strokePath):
      * platform/graphics/wx/PathWx.cpp:
      (WebCore::Path::Path):
      (WebCore::Path::~Path):
      (WebCore::Path::boundingRect):
      (WebCore::Path::operator=):
      (WebCore::Path::ensurePlatformPath):
      (WebCore):
      (WebCore::Path::clear):
      (WebCore::Path::moveTo):
      (WebCore::Path::addLineTo):
      (WebCore::Path::addQuadCurveTo):
      (WebCore::Path::addBezierCurveTo):
      (WebCore::Path::addArcTo):
      (WebCore::Path::closeSubpath):
      (WebCore::Path::addArc):
      (WebCore::Path::addRect):
      (WebCore::Path::addEllipse):
      (WebCore::Path::transform):
      (WebCore::Path::currentPoint):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ee9e9d9e
  4. 16 Mar, 2011 1 commit
    • abarth@webkit.org's avatar
      2011-03-16 Adam Barth <abarth@webkit.org> · 18df4063
      abarth@webkit.org authored
              Reviewed by Eric Seidel.
      
              WebCore GYP build should build platform/
              https://bugs.webkit.org/show_bug.cgi?id=56430
      
              Adding platform/ to the GYP build required disabling
              ALWAYS_SEARCH_USER_PATHS, which in turn required fixing some latent
              style issues.  I suspect we'll end up excluding some of these files
              from the build in the final analysis, but we might as well fix the
              style errors while we're here.
      
              * bindings/js/JSMainThreadExecState.h:
              * bindings/js/ScheduledAction.h:
              * css/CSSPrimitiveValueCache.cpp:
              * gyp/WebCore.gyp:
              * platform/KillRingNone.cpp:
              (WebCore::KillRing::append):
              (WebCore::KillRing::prepend):
              * platform/graphics/ContextShadow.h:
              * platform/graphics/gpu/LoopBlinnPathProcessor.cpp:
              (WebCore::LoopBlinnPathProcessor::buildContours):
              (WebCore::TessellationState::combineCallback):
              * platform/graphics/gpu/PODRedBlackTree.h:
              (WebCore::PODRedBlackTree::updateNode):
              (WebCore::PODRedBlackTree::logIfVerbose):
              * platform/graphics/opengl/TextureMapperGL.cpp:
              * platform/graphics/opengl/TextureMapperGL.h:
              * platform/graphics/texmap/TextureMapper.h:
              (WebCore::BitmapTexture::save):
              (WebCore::TextureMapper::paintToTarget):
              * platform/graphics/texmap/TextureMapperNode.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      18df4063
  5. 24 Feb, 2011 1 commit
    • paroga@webkit.org's avatar
      2011-02-24 Patrick Gansterer <paroga@webkit.org> · cb73e5d7
      paroga@webkit.org authored
              Reviewed by Eric Seidel.
      
              Rename PLATFORM(SKIA) to USE(SKIA)
              https://bugs.webkit.org/show_bug.cgi?id=55090
      
              * wtf/Platform.h:
      2011-02-24  Patrick Gansterer  <paroga@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Rename PLATFORM(SKIA) to USE(SKIA)
              https://bugs.webkit.org/show_bug.cgi?id=55090
      
              * config.h: Removed second define of PLATFORM(SKIA).
              * html/HTMLCanvasElement.cpp:
              * platform/graphics/FloatPoint.h:
              * platform/graphics/FloatRect.h:
              * platform/graphics/Gradient.cpp:
              * platform/graphics/Gradient.h:
              * platform/graphics/GraphicsContext.cpp:
              * platform/graphics/GraphicsContext.h:
              * platform/graphics/ImageSource.h:
              * platform/graphics/IntPoint.h:
              * platform/graphics/IntRect.h:
              * platform/graphics/Path.h:
              * platform/graphics/Pattern.cpp:
              * platform/graphics/Pattern.h:
              * platform/graphics/chromium/ContentLayerChromium.cpp:
              * platform/graphics/chromium/ContentLayerChromium.h:
              * platform/graphics/chromium/GLES2Canvas.cpp:
              * platform/graphics/chromium/ImageLayerChromium.cpp:
              * platform/graphics/chromium/LayerChromium.cpp:
              * platform/graphics/chromium/LayerRendererChromium.cpp:
              * platform/graphics/chromium/LayerRendererChromium.h:
              * platform/graphics/chromium/LayerTilerChromium.cpp:
              * platform/graphics/chromium/ShaderChromium.h:
              * platform/graphics/gpu/LoopBlinnPathProcessor.cpp:
              * platform/graphics/transforms/AffineTransform.h:
              * platform/graphics/transforms/TransformationMatrix.h:
              * platform/image-decoders/ImageDecoder.cpp:
              * platform/image-decoders/ImageDecoder.h:
              * rendering/svg/RenderSVGResourceSolidColor.cpp:
      2011-02-24  Patrick Gansterer  <paroga@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Rename PLATFORM(SKIA) to USE(SKIA)
              https://bugs.webkit.org/show_bug.cgi?id=55090
      
              * src/GraphicsContext3DChromium.cpp:
              (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal):
              (WebCore::GraphicsContext3DInternal::paintRenderingResultsToCanvas):
              * src/GraphicsContext3DInternal.h:
              * src/WebViewImpl.cpp:
              (WebKit::WebViewImpl::doPixelReadbackToCanvas):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79578 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cb73e5d7
  6. 10 Feb, 2011 1 commit
    • kbr@google.com's avatar
      2011-02-10 Kenneth Russell <kbr@google.com> · 5d7f3396
      kbr@google.com authored
              Reviewed by James Robinson.
      
              Incorporate algorithm for processing paths into GPU-renderable triangle meshes
              https://bugs.webkit.org/show_bug.cgi?id=45521
      
              Adding an implementation of Loop and Blinn's GPU accelerated path
              rendering algorithm from GPU Gems 3. This implementation pays
              particular attention to the efficiency of the curve subdivision
              phase needed for correct rendering. It utilizes the OpenGL utility
              library tessellator for triangulation of the interior of the
              shape. The regions handled by Loop and Blinn's algorithm are
              handled by the local triangulator previously incorporated.
      
              No tests yet; pixel tests will eventually be used to verify this
              algorithm and prevent regressions.
      
              * platform/graphics/gpu/LoopBlinnPathProcessor.cpp: Added.
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::Segment):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::setup):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::kind):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::getPoint):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::next):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::prev):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::setNext):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::setPrev):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::contour):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::subdivide):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::boundingBox):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::numCrossingsForXRay):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::numberOfTriangles):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::getTriangle):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::numberOfInteriorVertices):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::getInteriorVertex):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::markedForSubdivision):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::setMarkedForSubdivision):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::toString):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::computeBoundingBox):
              (WebCore::LoopBlinnPathProcessorImplementation::Contour::Contour):
              (WebCore::LoopBlinnPathProcessorImplementation::Contour::add):
              (WebCore::LoopBlinnPathProcessorImplementation::Contour::subdivide):
              (WebCore::LoopBlinnPathProcessorImplementation::Contour::begin):
              (WebCore::LoopBlinnPathProcessorImplementation::Contour::end):
              (WebCore::LoopBlinnPathProcessorImplementation::Contour::isOrientedCounterClockwise):
              (WebCore::LoopBlinnPathProcessorImplementation::Contour::setIsOrientedCounterClockwise):
              (WebCore::LoopBlinnPathProcessorImplementation::Contour::boundingBox):
              (WebCore::LoopBlinnPathProcessorImplementation::Contour::fillSide):
              (WebCore::LoopBlinnPathProcessorImplementation::Contour::setFillSide):
              (WebCore::LoopBlinnPathProcessorImplementation::Segment::triangulate):
              (WebCore::LoopBlinnPathProcessor::LoopBlinnPathProcessor):
              (WebCore::LoopBlinnPathProcessor::~LoopBlinnPathProcessor):
              (WebCore::LoopBlinnPathProcessor::process):
              (WebCore::LoopBlinnPathProcessor::buildContours):
              (WebCore::LoopBlinnPathProcessor::allSegmentsOverlappingY):
              (WebCore::LoopBlinnPathProcessor::determineSidesToFill):
              (WebCore::LoopBlinnPathProcessor::determineOrientation):
              (WebCore::SweepData::SweepEvent::SweepEvent):
              (WebCore::SweepData::SweepEvent::setup):
              (WebCore::SweepData::SweepEvent::x):
              (WebCore::SweepData::SweepEvent::entry):
              (WebCore::SweepData::SweepEvent::interval):
              (WebCore::SweepData::SweepEvent::operator<):
              (WebCore::SweepData::trianglesOverlap):
              (WebCore::LoopBlinnPathProcessor::subdivideCurves):
              (WebCore::LoopBlinnPathProcessor::conditionallySubdivide):
              (WebCore::LoopBlinnPathProcessor::subdivideCurvesSlow):
              (WebCore::TessellationState::vertexCallback):
              (WebCore::TessellationState::combineCallback):
              (WebCore::TessellationState::edgeFlagCallback):
              (WebCore::LoopBlinnPathProcessor::tessellateInterior):
              * platform/graphics/gpu/LoopBlinnPathProcessor.h: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5d7f3396