# CompositionCustomVisualHandler

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/rendering/composition/struct-compositioncustomvisualhandler/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct CompositionCustomVisualHandler
```

The state upstream's abstract `CompositionCustomVisualHandler` keeps,
and its protected members: what a handler class embeds and returns from
`ICompositionCustomVisualHandler::handler_base`.

The handler is created on the UI thread and used on the server only: it
is attached to the server-side custom visual when that visual is created.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_custom_visual_handler.rs#L17)

## Members

- [`new`](#function-new)
- [`effective_size`](#function-effective_size)
- [`composition_now`](#function-composition_now)
- [`invalidate`](#function-invalidate)
- [`invalidate_rect`](#function-invalidate_rect)
- [`register_for_next_animation_frame_update`](#function-register_for_next_animation_frame_update)
- [`render_clip_contains`](#function-render_clip_contains)
- [`render_clip_intersectes`](#function-render_clip_intersectes)

<a id="function-new"></a>

### new

```rust
fn new() -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_custom_visual_handler.rs#L46)

<a id="function-effective_size"></a>

### effective_size

```rust
fn effective_size(self: &Self) -> Vector
```

The size of the visual.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_custom_visual_handler.rs#L94)

<a id="function-composition_now"></a>

### composition_now

```rust
fn composition_now(self: &Self) -> Duration
```

The time of the server compositor.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_custom_visual_handler.rs#L99)

<a id="function-invalidate"></a>

### invalidate

```rust
fn invalidate(self: &Self)
```

Asks for the visual to be redrawn.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_custom_visual_handler.rs#L108)

<a id="function-invalidate_rect"></a>

### invalidate_rect

```rust
fn invalidate_rect(self: &Self, rc: Rect)
```

Asks for an area of the visual to be redrawn.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_custom_visual_handler.rs#L113)

<a id="function-register_for_next_animation_frame_update"></a>

### register_for_next_animation_frame_update

```rust
fn register_for_next_animation_frame_update(self: &Self)
```

Asks for `ICompositionCustomVisualHandler::on_animation_frame_update`
to be called on the next frame.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_custom_visual_handler.rs#L119)

<a id="function-render_clip_contains"></a>

### render_clip_contains

```rust
fn render_clip_contains(self: &Self, pt: Point) -> bool
```

Whether a point of the visual is inside the current clip.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_custom_visual_handler.rs#L125)

<a id="function-render_clip_intersectes"></a>

### render_clip_intersectes

```rust
fn render_clip_intersectes(self: &Self, rc: Rect) -> bool
```

Whether a rectangle of the visual intersects the current clip.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_custom_visual_handler.rs#L132)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `Default`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
