Changeset 125790 in webkit


Ignore:
Timestamp:
Aug 16, 2012 10:22:44 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: added Paint events for Images to TimelineAgent
https://bugs.webkit.org/show_bug.cgi?id=90277

Patch by Sergey Rogulenko <rogulenko@google.com> on 2012-08-16
Reviewed by Pavel Feldman.

Source/WebCore:

  • add DecodeImage & ResizeImage timeline events;
  • implement {will,did}DecodeImage and {will,did}ResizeImage methods of Timeline agent;

Test: inspector/timeline/timeline-decode-resize.html

  • English.lproj/localizedStrings.js:
  • inspector/InspectorTimelineAgent.cpp:

(TimelineRecordType):
(WebCore::InspectorTimelineAgent::willDecodeImage):
(WebCore::InspectorTimelineAgent::didDecodeImage):
(WebCore::InspectorTimelineAgent::willResizeImage):
(WebCore::InspectorTimelineAgent::didResizeImage):

  • inspector/TimelineRecordFactory.cpp:

(WebCore::TimelineRecordFactory::createDecodeImageData):
(WebCore):
(WebCore::TimelineRecordFactory::createResizeImageData):

  • inspector/TimelineRecordFactory.h:

(TimelineRecordFactory):

  • inspector/front-end/TimelineModel.js:
  • inspector/front-end/TimelinePresentationModel.js:

(WebInspector.TimelinePresentationModel.initRecordStyles_):
(WebInspector.TimelinePresentationModel.Record.prototype._getRecordDetails):

LayoutTests:

Added a test and fixed enum-stabitily because of a new Timeline Event.

  • inspector/timeline/resources/big.png: Added.
  • inspector/timeline/resources/test.bmp: Added.
  • inspector/timeline/resources/test.gif: Added.
  • inspector/timeline/resources/test.ico: Added.
  • inspector/timeline/resources/test.jpg: Added.
  • inspector/timeline/resources/test.png: Added.
  • inspector/timeline/resources/test.webp: Added.
  • inspector/timeline/timeline-decode-resize-expected.txt: Added.
  • inspector/timeline/timeline-decode-resize.html: Added.
  • inspector/timeline/timeline-enum-stability-expected.txt:
Location:
trunk
Files:
9 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r125789 r125790  
     12012-08-16  Sergey Rogulenko  <rogulenko@google.com>
     2
     3        Web Inspector: added Paint events for Images to TimelineAgent
     4        https://bugs.webkit.org/show_bug.cgi?id=90277
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Added a test and fixed enum-stabitily because of a new Timeline Event.
     9
     10        * inspector/timeline/resources/big.png: Added.
     11        * inspector/timeline/resources/test.bmp: Added.
     12        * inspector/timeline/resources/test.gif: Added.
     13        * inspector/timeline/resources/test.ico: Added.
     14        * inspector/timeline/resources/test.jpg: Added.
     15        * inspector/timeline/resources/test.png: Added.
     16        * inspector/timeline/resources/test.webp: Added.
     17        * inspector/timeline/timeline-decode-resize-expected.txt: Added.
     18        * inspector/timeline/timeline-decode-resize.html: Added.
     19        * inspector/timeline/timeline-enum-stability-expected.txt:
     20
    1212012-08-16  Adrienne Walker  <enne@google.com>
    222
  • trunk/LayoutTests/inspector/timeline/timeline-enum-stability-expected.txt

    r122312 r125790  
    1111    RecalculateStyles : "RecalculateStyles"
    1212    Paint : "Paint"
     13    DecodeImage : "DecodeImage"
     14    ResizeImage : "ResizeImage"
    1315    CompositeLayers : "CompositeLayers"
    1416    ParseHTML : "ParseHTML"
  • trunk/Source/WebCore/ChangeLog

    r125788 r125790  
     12012-08-16  Sergey Rogulenko  <rogulenko@google.com>
     2
     3        Web Inspector: added Paint events for Images to TimelineAgent
     4        https://bugs.webkit.org/show_bug.cgi?id=90277
     5
     6        Reviewed by Pavel Feldman.
     7
     8        - add DecodeImage & ResizeImage timeline events;
     9        - implement {will,did}DecodeImage and {will,did}ResizeImage methods of Timeline agent;
     10
     11        Test: inspector/timeline/timeline-decode-resize.html
     12
     13        * English.lproj/localizedStrings.js:
     14        * inspector/InspectorTimelineAgent.cpp:
     15        (TimelineRecordType):
     16        (WebCore::InspectorTimelineAgent::willDecodeImage):
     17        (WebCore::InspectorTimelineAgent::didDecodeImage):
     18        (WebCore::InspectorTimelineAgent::willResizeImage):
     19        (WebCore::InspectorTimelineAgent::didResizeImage):
     20        * inspector/TimelineRecordFactory.cpp:
     21        (WebCore::TimelineRecordFactory::createDecodeImageData):
     22        (WebCore):
     23        (WebCore::TimelineRecordFactory::createResizeImageData):
     24        * inspector/TimelineRecordFactory.h:
     25        (TimelineRecordFactory):
     26        * inspector/front-end/TimelineModel.js:
     27        * inspector/front-end/TimelinePresentationModel.js:
     28        (WebInspector.TimelinePresentationModel.initRecordStyles_):
     29        (WebInspector.TimelinePresentationModel.Record.prototype._getRecordDetails):
     30
    1312012-08-16  James Robinson  <jamesr@chromium.org>
    232
  • trunk/Source/WebCore/English.lproj/localizedStrings.js

    r124486 r125790  
    297297localizedStrings["Device metrics"] = "Device metrics";
    298298localizedStrings["Paint"] = "Paint";
     299localizedStrings["Image Decode"] = "Image Decode";
     300localizedStrings["Image Resize"] = "Image Resize";
     301localizedStrings["cached"] = "cached";
     302localizedStrings["non-cached"] = "non-cached";
    299303localizedStrings["Parse"] = "Parse";
    300304localizedStrings["Parser"] = "Parser";
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp

    r125769 r125790  
    6969static const char RecalculateStyles[] = "RecalculateStyles";
    7070static const char Paint[] = "Paint";
     71static const char DecodeImage[] = "DecodeImage";
     72static const char ResizeImage[] = "ResizeImage";
    7173static const char CompositeLayers[] = "CompositeLayers";
    7274
     
    256258}
    257259
    258 void InspectorTimelineAgent::willDecodeImage(const String&)
    259 {
     260void InspectorTimelineAgent::willDecodeImage(const String& imageType)
     261{
     262    pushCurrentRecord(TimelineRecordFactory::createDecodeImageData(imageType), TimelineRecordType::DecodeImage, true, 0);
    260263}
    261264
    262265void InspectorTimelineAgent::didDecodeImage()
    263266{
    264 }
    265 
    266 void InspectorTimelineAgent::willResizeImage(bool)
    267 {
     267    didCompleteCurrentRecord(TimelineRecordType::DecodeImage);
     268}
     269
     270void InspectorTimelineAgent::willResizeImage(bool shouldCache)
     271{
     272    pushCurrentRecord(TimelineRecordFactory::createResizeImageData(shouldCache), TimelineRecordType::ResizeImage, true, 0);
    268273}
    269274
    270275void InspectorTimelineAgent::didResizeImage()
    271276{
     277    didCompleteCurrentRecord(TimelineRecordType::ResizeImage);
    272278}
    273279
  • trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp

    r121592 r125790  
    180180}
    181181
     182PassRefPtr<InspectorObject> TimelineRecordFactory::createDecodeImageData(const String& imageType)
     183{
     184    RefPtr<InspectorObject> data = InspectorObject::create();
     185    data->setString("imageType", imageType);
     186    return data.release();
     187}
     188
     189PassRefPtr<InspectorObject> TimelineRecordFactory::createResizeImageData(bool shouldCache)
     190{
     191    RefPtr<InspectorObject> data = InspectorObject::create();
     192    data->setBoolean("cached", shouldCache);
     193    return data.release();
     194}
     195
    182196PassRefPtr<InspectorObject> TimelineRecordFactory::createParseHTMLData(unsigned int length, unsigned int startLine)
    183197{
  • trunk/Source/WebCore/inspector/TimelineRecordFactory.h

    r121592 r125790  
    7878        static PassRefPtr<InspectorObject> createPaintData(const LayoutRect&);
    7979
     80        static PassRefPtr<InspectorObject> createDecodeImageData(const String& imageType);
     81
     82        static PassRefPtr<InspectorObject> createResizeImageData(bool shouldCache);
     83
    8084        static PassRefPtr<InspectorObject> createParseHTMLData(unsigned int length, unsigned int startLine);
    8185
  • trunk/Source/WebCore/inspector/front-end/TimelineModel.js

    r125168 r125790  
    5353    RecalculateStyles: "RecalculateStyles",
    5454    Paint: "Paint",
     55    DecodeImage: "DecodeImage",
     56    ResizeImage: "ResizeImage",
    5557    CompositeLayers: "CompositeLayers",
    5658
  • trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js

    r125272 r125790  
    7676    recordStyles[recordTypes.RecalculateStyles] = { title: WebInspector.UIString("Recalculate Style"), category: categories["rendering"] };
    7777    recordStyles[recordTypes.Paint] = { title: WebInspector.UIString("Paint"), category: categories["painting"] };
     78    recordStyles[recordTypes.DecodeImage] = { title: WebInspector.UIString("Image Decode"), category: categories["painting"] };
     79    recordStyles[recordTypes.ResizeImage] = { title: WebInspector.UIString("Image Resize"), category: categories["painting"] };
    7880    recordStyles[recordTypes.CompositeLayers] = { title: WebInspector.UIString("Composite Layers"), category: categories["painting"] };
    7981    recordStyles[recordTypes.ParseHTML] = { title: WebInspector.UIString("Parse"), category: categories["loading"] };
     
    752754            case WebInspector.TimelineModel.RecordType.Paint:
    753755                return this.data["width"] + "\u2009\u00d7\u2009" + this.data["height"];
     756            case WebInspector.TimelineModel.RecordType.DecodeImage:
     757                return this.data["imageType"];
     758            case WebInspector.TimelineModel.RecordType.ResizeImage:
     759                return this.data["cached"] ? WebInspector.UIString("cached") : WebInspector.UIString("non-cached");
    754760            case WebInspector.TimelineModel.RecordType.TimerInstall:
    755761            case WebInspector.TimelineModel.RecordType.TimerRemove:
Note: See TracChangeset for help on using the changeset viewer.