Delete chrome.mediaGalleriesPrivate because the functionality unique to it has since...
[chromium-blink-merge.git] / cc / resources / clip_path_display_item.cc
blob4012124cd0efdf3533baba5d5380958d267ebe1f
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"
9 namespace cc {
11 ClipPathDisplayItem::ClipPathDisplayItem(const SkPath& clip_path,
12 SkRegion::Op clip_op,
13 bool antialias)
14 : clip_path_(clip_path), clip_op_(clip_op), antialias_(antialias) {
17 ClipPathDisplayItem::~ClipPathDisplayItem() {
20 void ClipPathDisplayItem::Raster(SkCanvas* canvas,
21 SkDrawPictureCallback* callback) const {
22 canvas->save();
23 canvas->clipPath(clip_path_, clip_op_, antialias_);
26 bool ClipPathDisplayItem::IsSuitableForGpuRasterization() const {
27 return true;
30 int ClipPathDisplayItem::ApproximateOpCount() const {
31 return 1;
34 size_t ClipPathDisplayItem::PictureMemoryUsage() const {
35 size_t total_size = sizeof(SkPath) + sizeof(SkRegion::Op) + sizeof(bool);
36 return total_size;
39 EndClipPathDisplayItem::EndClipPathDisplayItem() {
42 EndClipPathDisplayItem::~EndClipPathDisplayItem() {
45 void EndClipPathDisplayItem::Raster(SkCanvas* canvas,
46 SkDrawPictureCallback* callback) const {
47 canvas->restore();
50 bool EndClipPathDisplayItem::IsSuitableForGpuRasterization() const {
51 return true;
54 int EndClipPathDisplayItem::ApproximateOpCount() const {
55 return 0;
58 size_t EndClipPathDisplayItem::PictureMemoryUsage() const {
59 return 0;
62 } // namespace cc