---
title: globalCompositeOperation
framework: webkitjs
role: symbol
role_heading: Instance Property
path: webkitjs/canvasrenderingcontext2d/1632770-globalcompositeoperation
---

# globalCompositeOperation

A string representing the compositing method for drawing operations.

## Declaration

```data
attribute DOMString globalCompositeOperation;
```

## Discussion

Discussion By default, drawings layer on top of one another in drawing order, with opaque areas obscuring existing layers and transparent or translucent areas being blended with existing layers according to their alpha value. Set the globalCompositeOperation property to one of the globalCompositeOperation constants to override the default compositing method. The allowed values are source-atop, source-in, source-out, source-over, destination-atop, destination-in, destination-out, destination-over, lighter, copy, and xor. See Global Compositing Operation Constants for details.

## See Also

### Compositing

- [globalAlpha](webkitjs/canvasrenderingcontext2d/1631404-globalalpha.md)
