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

Side by Side Diff: Source/core/platform/graphics/transforms/PerspectiveTransformOperation.cpp

Issue 22900008: Make vw/vh units to work in css transforms. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 15 matching lines...) Expand all
26 #include "config.h" 26 #include "config.h"
27 #include "core/platform/graphics/transforms/PerspectiveTransformOperation.h" 27 #include "core/platform/graphics/transforms/PerspectiveTransformOperation.h"
28 28
29 #include "core/platform/animation/AnimationUtilities.h" 29 #include "core/platform/animation/AnimationUtilities.h"
30 #include "wtf/MathExtras.h" 30 #include "wtf/MathExtras.h"
31 31
32 using namespace std; 32 using namespace std;
33 33
34 namespace WebCore { 34 namespace WebCore {
35 35
36 PassRefPtr<TransformOperation> PerspectiveTransformOperation::blend(const Transf ormOperation* from, double progress, bool blendToIdentity) 36 PassRefPtr<TransformOperation> PerspectiveTransformOperation::blend(const Transf ormOperation* from, double progress, bool blendToIdentity, RenderView* renderVie w)
37 { 37 {
38 if (from && !from->isSameType(*this)) 38 if (from && !from->isSameType(*this))
39 return this; 39 return this;
40 40
41 if (blendToIdentity) { 41 if (blendToIdentity) {
42 double p = floatValueForLength(m_p, 1); 42 double p = floatValueForLength(m_p, 1);
43 p = WebCore::blend(p, 1.0, progress); // FIXME: this seems wrong. https: //bugs.webkit.org/show_bug.cgi?id=52700 43 p = WebCore::blend(p, 1.0, progress); // FIXME: this seems wrong. https: //bugs.webkit.org/show_bug.cgi?id=52700
44 return PerspectiveTransformOperation::create(Length(clampToPositiveInteg er(p), Fixed)); 44 return PerspectiveTransformOperation::create(Length(clampToPositiveInteg er(p), Fixed));
45 } 45 }
46 46
(...skipping 10 matching lines...) Expand all
57 toT.decompose(decomp); 57 toT.decompose(decomp);
58 58
59 if (decomp.perspectiveZ) { 59 if (decomp.perspectiveZ) {
60 double val = -1.0 / decomp.perspectiveZ; 60 double val = -1.0 / decomp.perspectiveZ;
61 return PerspectiveTransformOperation::create(Length(clampToPositiveInteg er(val), Fixed)); 61 return PerspectiveTransformOperation::create(Length(clampToPositiveInteg er(val), Fixed));
62 } 62 }
63 return PerspectiveTransformOperation::create(Length(0, Fixed)); 63 return PerspectiveTransformOperation::create(Length(0, Fixed));
64 } 64 }
65 65
66 } // namespace WebCore 66 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698