Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/WebKit/Source/platform/transforms/TranslateTransformOperation.h

Issue 2725973003: Add a use-counter for transforms using the reference box on SVG element (Closed)
Patch Set: Rebase; update histograms.xml Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 29 matching lines...) Expand all
40 return adoptRef(new TranslateTransformOperation(tx, ty, 0, type)); 40 return adoptRef(new TranslateTransformOperation(tx, ty, 0, type));
41 } 41 }
42 42
43 static PassRefPtr<TranslateTransformOperation> create(const Length& tx, 43 static PassRefPtr<TranslateTransformOperation> create(const Length& tx,
44 const Length& ty, 44 const Length& ty,
45 double tz, 45 double tz,
46 OperationType type) { 46 OperationType type) {
47 return adoptRef(new TranslateTransformOperation(tx, ty, tz, type)); 47 return adoptRef(new TranslateTransformOperation(tx, ty, tz, type));
48 } 48 }
49 49
50 virtual bool canBlendWith(const TransformOperation& other) const; 50 bool canBlendWith(const TransformOperation& other) const override;
51 bool dependsOnBoxSize() const override {
52 return m_x.isPercentOrCalc() || m_y.isPercentOrCalc();
53 }
51 54
52 double x(const FloatSize& borderBoxSize) const { 55 double x(const FloatSize& borderBoxSize) const {
53 return floatValueForLength(m_x, borderBoxSize.width()); 56 return floatValueForLength(m_x, borderBoxSize.width());
54 } 57 }
55 double y(const FloatSize& borderBoxSize) const { 58 double y(const FloatSize& borderBoxSize) const {
56 return floatValueForLength(m_y, borderBoxSize.height()); 59 return floatValueForLength(m_y, borderBoxSize.height());
57 } 60 }
58 61
59 Length x() const { return m_x; } 62 Length x() const { return m_x; }
60 Length y() const { return m_y; } 63 Length y() const { return m_y; }
(...skipping 23 matching lines...) Expand all
84 return m_x == t->m_x && m_y == t->m_y && m_z == t->m_z; 87 return m_x == t->m_x && m_y == t->m_y && m_z == t->m_z;
85 } 88 }
86 89
87 PassRefPtr<TransformOperation> blend(const TransformOperation* from, 90 PassRefPtr<TransformOperation> blend(const TransformOperation* from,
88 double progress, 91 double progress,
89 bool blendToIdentity = false) override; 92 bool blendToIdentity = false) override;
90 PassRefPtr<TransformOperation> zoom(double factor) final { 93 PassRefPtr<TransformOperation> zoom(double factor) final {
91 return zoomTranslate(factor); 94 return zoomTranslate(factor);
92 } 95 }
93 96
94 bool dependsOnBoxSize() const override {
95 return m_x.isPercentOrCalc() || m_y.isPercentOrCalc();
96 }
97
98 TranslateTransformOperation(const Length& tx, 97 TranslateTransformOperation(const Length& tx,
99 const Length& ty, 98 const Length& ty,
100 double tz, 99 double tz,
101 OperationType type) 100 OperationType type)
102 : m_x(tx), m_y(ty), m_z(tz), m_type(type) { 101 : m_x(tx), m_y(ty), m_z(tz), m_type(type) {
103 ASSERT(isMatchingOperationType(type)); 102 ASSERT(isMatchingOperationType(type));
104 } 103 }
105 104
106 Length m_x; 105 Length m_x;
107 Length m_y; 106 Length m_y;
108 double m_z; 107 double m_z;
109 OperationType m_type; 108 OperationType m_type;
110 }; 109 };
111 110
112 DEFINE_TRANSFORM_TYPE_CASTS(TranslateTransformOperation); 111 DEFINE_TRANSFORM_TYPE_CASTS(TranslateTransformOperation);
113 112
114 } // namespace blink 113 } // namespace blink
115 114
116 #endif // TranslateTransformOperation_h 115 #endif // TranslateTransformOperation_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGElement.cpp ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698