[cairo] clear operator

Andrea Canciani ranma42 at gmail.com
Wed Jun 1 07:34:49 PDT 2011


On Wed, Jun 1, 2011 at 12:33 PM, control H <control.h at gmail.com> wrote:
>> Using http://cairographics.org/operators/ as reference:
>>  - paint implies a mask which covers the whole surface (1 everywhere)
>>  - CLEAR ignores the context source
>>  - you have not clipped to anything
>>
>> The expected result can be computed based on the "Bounded" formula:
>> (src CLEAR dst) LERP_(clip IN mask) dst =
>> (0) LERP_(1 IN 1) dst =
>> 0 LERP_1 dst = dst
>
> OK so it is because in my case something is not clipped or bounded.
> But why does the first example (CLEAR) on
> http://cairographics.org/operators/ give the result I expect? Why is
> something clipped there? I looked at the code but I can't figure out.

In the example, the CLEAR operator is used when filling the "blue rectangle"
with an opaque blue solid color.
You are using paint(), so you're doing the same operation as that
example, but with a rectangle that covers the whole surface.

Andrea


More information about the cairo mailing list