1 // Copyright 2014 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/transform_display_item.h"
7 #include "third_party/skia/include/core/SkCanvas.h"
11 TransformDisplayItem::TransformDisplayItem(const gfx::Transform
& transform
)
12 : transform_(transform
) {
15 TransformDisplayItem::~TransformDisplayItem() {
18 void TransformDisplayItem::Raster(SkCanvas
* canvas
,
19 SkDrawPictureCallback
* callback
) const {
21 if (!transform_
.IsIdentity())
22 canvas
->concat(transform_
.matrix());
25 bool TransformDisplayItem::IsSuitableForGpuRasterization() const {
29 int TransformDisplayItem::ApproximateOpCount() const {
33 size_t TransformDisplayItem::PictureMemoryUsage() const {
34 return sizeof(gfx::Transform
);
37 EndTransformDisplayItem::EndTransformDisplayItem() {
40 EndTransformDisplayItem::~EndTransformDisplayItem() {
43 void EndTransformDisplayItem::Raster(SkCanvas
* canvas
,
44 SkDrawPictureCallback
* callback
) const {
48 bool EndTransformDisplayItem::IsSuitableForGpuRasterization() const {
52 int EndTransformDisplayItem::ApproximateOpCount() const {
56 size_t EndTransformDisplayItem::PictureMemoryUsage() const {