Closed Bug 988088 Opened 10 years ago Closed 10 years ago

Cache path objects in Path2D implementation

Categories

(Core :: Graphics: Canvas2D, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: cabanier, Assigned: cabanier)

Details

Attachments

(1 file, 2 obsolete files)

Currently, the path object is recreated each time it is used in a canvas call.
This causes unnecessary overhead since the path likely is cached and won't change.
Assignee: nobody → cabanier
Summary: Cache path objects if possible in Path2D implementation → Cache path objects in Path2D implementation
Attachment #8396815 - Flags: review?(roc)
Attachment #8396815 - Flags: review?(roc)
Attachment #8396815 - Attachment is obsolete: true
Comment on attachment 8396815 [details] [diff] [review]
Implementation of path cache in Path2D

try build: https://tbpl.mozilla.org/?tree=Try&rev=7c8ceff33730
Previous submit had a logic error that was caught on Windows.
Attachment #8396815 - Flags: review?(roc)
Attachment #8397155 - Flags: review?(roc)
Attachment #8396815 - Flags: review?(roc)
Attachment #8397155 - Flags: review?(roc) → review?(vladimir)
Attachment #8397155 - Flags: review?(vladimir) → review?(bas)
Comment on attachment 8397155 [details] [diff] [review]
Implementation of path cache in Path2D

Review of attachment 8397155 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/canvas/src/CanvasRenderingContext2D.cpp
@@ +4547,4 @@
>  }
>  
> +void
> +CanvasPath::ensurePathBuilder() const

"EnsurePathBuilder"

@@ +4555,5 @@
> +
> +  // if there is not pathbuilder, there must be a path
> +  MOZ_ASSERT(mPath);
> +  mPathBuilder = mPath->CopyToBuilder();
> +  mPath = NULL;

nullptr
Attachment #8397155 - Flags: review?(bas) → review+
Attachment #8397155 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/9204362c5122
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
The following changeset is now in Firefox Nightly:

> 9204362c5122 Bug 988088 - Cache path objects in Path2D implementation. r=bas

Nightly Build Information:

        ID: 20140402030201
 Changeset: 4941a2ac0786109b08856738019b016a6c5a66a6
   Version: 31.0a1
      TBPL: https://tbpl.mozilla.org/?rev=4941a2ac0786
       URL: https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2014/04/2014-04-02-03-02-01-mozilla-central

Download Links:

>         Linux x86: https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2014/04/2014-04-02-03-02-01-mozilla-central/firefox-31.0a1.en-US.linux-i686.tar.bz2
>      Linux x86_64: https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2014/04/2014-04-02-03-02-01-mozilla-central/firefox-31.0a1.en-US.linux-x86_64.tar.bz2
> Linux x86_64 ASAN: https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2014/04/2014-04-02-03-02-01-mozilla-central/firefox-31.0a1.en-US.linux-x86_64-asan.tar.bz2
>               Mac: https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2014/04/2014-04-02-03-02-01-mozilla-central/firefox-31.0a1.en-US.mac.dmg
>             Win32: https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2014/04/2014-04-02-03-02-01-mozilla-central/firefox-31.0a1.en-US.win32.installer.exe
>             Win64: https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2014/04/2014-04-02-03-02-01-mozilla-central/firefox-31.0a1.en-US.win64-x86_64.installer.exe

Previous Nightly Build Information:

        ID: 20140401030203
 Changeset: 1417d180a1d8665b1a91b897d1cc4cc31e7980d4
   Version: 31.0a1
      TBPL: https://tbpl.mozilla.org/?rev=1417d180a1d8
       URL: https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2014/04/2014-04-01-03-02-03-mozilla-central
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: