Add test for clicking bookmark star in presence of ctrl-D keybinding
[chromium-blink-merge.git] / cc / resources / transform_display_item.cc
blobc7f4d605402ed9f1f6ddaadcca75a6237759d7b0
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"
9 namespace cc {
11 TransformDisplayItem::TransformDisplayItem(const gfx::Transform& transform)
12 : transform_(transform) {
15 TransformDisplayItem::~TransformDisplayItem() {
18 void TransformDisplayItem::Raster(SkCanvas* canvas,
19 SkDrawPictureCallback* callback) const {
20 canvas->save();
21 if (!transform_.IsIdentity())
22 canvas->concat(transform_.matrix());
25 bool TransformDisplayItem::IsSuitableForGpuRasterization() const {
26 return true;
29 int TransformDisplayItem::ApproximateOpCount() const {
30 return 1;
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 {
45 canvas->restore();
48 bool EndTransformDisplayItem::IsSuitableForGpuRasterization() const {
49 return true;
52 int EndTransformDisplayItem::ApproximateOpCount() const {
53 return 0;
56 size_t EndTransformDisplayItem::PictureMemoryUsage() const {
57 return 0;
60 } // namespace cc