1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "cc/resources/clip_path_display_item.h"
7 #include "third_party/skia/include/core/SkCanvas.h"
11 ClipPathDisplayItem::ClipPathDisplayItem(const SkPath
& clip_path
,
14 : clip_path_(clip_path
), clip_op_(clip_op
), antialias_(antialias
) {
17 ClipPathDisplayItem::~ClipPathDisplayItem() {
20 void ClipPathDisplayItem::Raster(SkCanvas
* canvas
,
21 SkDrawPictureCallback
* callback
) const {
23 canvas
->clipPath(clip_path_
, clip_op_
, antialias_
);
26 bool ClipPathDisplayItem::IsSuitableForGpuRasterization() const {
30 int ClipPathDisplayItem::ApproximateOpCount() const {
34 size_t ClipPathDisplayItem::PictureMemoryUsage() const {
35 size_t total_size
= sizeof(SkPath
) + sizeof(SkRegion::Op
) + sizeof(bool);
39 EndClipPathDisplayItem::EndClipPathDisplayItem() {
42 EndClipPathDisplayItem::~EndClipPathDisplayItem() {
45 void EndClipPathDisplayItem::Raster(SkCanvas
* canvas
,
46 SkDrawPictureCallback
* callback
) const {
50 bool EndClipPathDisplayItem::IsSuitableForGpuRasterization() const {
54 int EndClipPathDisplayItem::ApproximateOpCount() const {
58 size_t EndClipPathDisplayItem::PictureMemoryUsage() const {