Changeset 244562 in webkit


Ignore:
Timestamp:
Apr 23, 2019 1:32:39 PM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Canvas: support recording TypedOMCSSImageValue
https://bugs.webkit.org/show_bug.cgi?id=192609

Reviewed by Timothy Hatcher.

  • inspector/InspectorCanvas.h:
  • inspector/InspectorCanvas.cpp:

(WebCore::InspectorCanvas::indexForData):
(WebCore::InspectorCanvas::buildAction):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r244561 r244562  
     12019-04-23  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Canvas: support recording TypedOMCSSImageValue
     4        https://bugs.webkit.org/show_bug.cgi?id=192609
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * inspector/InspectorCanvas.h:
     9        * inspector/InspectorCanvas.cpp:
     10        (WebCore::InspectorCanvas::indexForData):
     11        (WebCore::InspectorCanvas::buildAction):
     12
    1132019-04-23  Andres Gonzalez  <andresg_22@apple.com>
    214
  • trunk/Source/WebCore/inspector/InspectorCanvas.cpp

    r243666 r244562  
    5858#include "SVGPathUtilities.h"
    5959#include "StringAdaptors.h"
     60#if ENABLE(CSS_TYPED_OM)
     61#include "TypedOMCSSImageValue.h"
     62#endif
    6063#if ENABLE(WEBGL)
    6164#include "WebGLRenderingContext.h"
     
    455458            item = WTFMove(array);
    456459        },
     460#if ENABLE(CSS_TYPED_OM)
     461        [&] (const RefPtr<TypedOMCSSImageValue>& cssImageValue) {
     462            String dataURL = "data:,"_s;
     463
     464            if (auto* cachedImage = cssImageValue->image()) {
     465                auto* image = cachedImage->image();
     466                if (image && image != &Image::nullImage()) {
     467                    auto imageBuffer = ImageBuffer::create(image->size(), RenderingMode::Unaccelerated);
     468                    imageBuffer->context().drawImage(*image, FloatPoint(0, 0));
     469                    dataURL = imageBuffer->toDataURL("image/png");
     470                }
     471            }
     472
     473            index = indexForData(dataURL);
     474        },
     475#endif
    457476        [&] (const ScriptCallFrame& scriptCallFrame) {
    458477            auto array = JSON::ArrayOf<double>::create();
     
    665684#endif
    666685#if ENABLE(CSS_TYPED_OM)
    667             // FIXME implement: <https://bugs.webkit.org/show_bug.cgi?id=192609>.
    668             [&] (const RefPtr<TypedOMCSSImageValue>&) { },
     686            [&] (const RefPtr<TypedOMCSSImageValue>& value) { addParameter(indexForData(value), RecordingSwizzleTypes::Image); },
    669687#endif
    670688            [&] (const RefPtr<ImageBitmap>& value) { addParameter(indexForData(value), RecordingSwizzleTypes::ImageBitmap); },
  • trunk/Source/WebCore/inspector/InspectorCanvas.h

    r243400 r244562  
    4444class ImageBitmap;
    4545class ImageData;
     46#if ENABLE(CSS_TYPED_OM)
     47class TypedOMCSSImageValue;
     48#endif
    4649
    4750typedef String ErrorString;
     
    9598        RefPtr<ImageBitmap>,
    9699        RefPtr<Inspector::ScriptCallStack>,
     100#if ENABLE(CSS_TYPED_OM)
     101        RefPtr<TypedOMCSSImageValue>,
     102#endif
    97103        Inspector::ScriptCallFrame,
    98104        String
Note: See TracChangeset for help on using the changeset viewer.