W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > October 2011

[Bug 14499] New: Need ability to reset Canvas clipping region without resetting all other Canvas state

From: <bugzilla@jessica.w3.org>
Date: Tue, 18 Oct 2011 16:37:27 +0000
To: public-html-bugzilla@w3.org
Message-ID: <bug-14499-2486@http.www.w3.org/Bugs/Public/>

           Summary: Need ability to reset Canvas clipping region without
                    resetting all other Canvas state
           Product: HTML WG
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: HTML Canvas 2D Context (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: simon.sarris@gmail.com
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,

The clipping region is defined such that it can only get smaller and never

"The clip() method must create a new clipping region by calculating the
intersection of the current clipping region and the area described by the
current path, using the non-zero winding number rule."

In other words, one cannot define a clipping region of (50,50,50,50) and then
define a larger one of (0,0,200,200). The clipping region will still be

This rule itself is fine. But if one wants to clip and then reset the clipping
region back to default (the entire canvas) there is currently no way to do that
short of resetting all canvas state, either by changing the size of the canvas
(destroys all state) or using save() and restore().

But there are plenty of reasons for wanting the canvas state to persist
otherwise while resetting the clipping region. Most of them are
performance/caching reasons that can make a significant difference. If one
wanted to draw 7,000 strings with a single font but wanted a different clipping
region for each, one would have to set the font property of the canvas 7,000
times instead of just once. This is murder on performance when it need not be

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Tuesday, 18 October 2011 16:37:31 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:02:06 UTC