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

Side by Side Diff: Source/core/css/resolver/TransformBuilder.cpp

Issue 15072003: Move StyleResolver and related classes to core/css/resolver (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
11 * Copyright (C) 2012 Google Inc. All rights reserved. 11 * Copyright (C) 2012 Google Inc. All rights reserved.
12 * 12 *
13 * This library is free software; you can redistribute it and/or 13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public 14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either 15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version. 16 * version 2 of the License, or (at your option) any later version.
17 * 17 *
18 * This library is distributed in the hope that it will be useful, 18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details. 21 * Library General Public License for more details.
22 * 22 *
23 * You should have received a copy of the GNU Library General Public License 23 * You should have received a copy of the GNU Library General Public License
24 * along with this library; see the file COPYING.LIB. If not, write to 24 * along with this library; see the file COPYING.LIB. If not, write to
25 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 25 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26 * Boston, MA 02110-1301, USA. 26 * Boston, MA 02110-1301, USA.
27 */ 27 */
28 28
29 #include "config.h" 29 #include "config.h"
30 #include "core/css/TransformBuilder.h" 30 #include "core/css/resolver/TransformBuilder.h"
31 31
32 #include "core/css/CSSPrimitiveValueMappings.h"
33 #include "core/css/WebKitCSSFilterValue.h"
32 #include "core/css/WebKitCSSTransformValue.h" 34 #include "core/css/WebKitCSSTransformValue.h"
33 #include "core/rendering/style/RenderStyle.h" 35 #include "core/platform/graphics/filters/FilterOperation.h"
34 #include "core/platform/graphics/transforms/Matrix3DTransformOperation.h" 36 #include "core/platform/graphics/transforms/Matrix3DTransformOperation.h"
35 #include "core/platform/graphics/transforms/MatrixTransformOperation.h" 37 #include "core/platform/graphics/transforms/MatrixTransformOperation.h"
36 #include "core/platform/graphics/transforms/PerspectiveTransformOperation.h" 38 #include "core/platform/graphics/transforms/PerspectiveTransformOperation.h"
37 #include "core/platform/graphics/transforms/RotateTransformOperation.h" 39 #include "core/platform/graphics/transforms/RotateTransformOperation.h"
38 #include "core/platform/graphics/transforms/ScaleTransformOperation.h" 40 #include "core/platform/graphics/transforms/ScaleTransformOperation.h"
39 #include "core/platform/graphics/transforms/SkewTransformOperation.h" 41 #include "core/platform/graphics/transforms/SkewTransformOperation.h"
40 #include "core/platform/graphics/transforms/TransformationMatrix.h" 42 #include "core/platform/graphics/transforms/TransformationMatrix.h"
41 #include "core/platform/graphics/transforms/TranslateTransformOperation.h" 43 #include "core/platform/graphics/transforms/TranslateTransformOperation.h"
42 44 #include "core/rendering/style/RenderStyle.h"
43 #include "core/css/WebKitCSSFilterValue.h"
44 #include "core/platform/graphics/filters/FilterOperation.h"
45 #include "core/css/CSSPrimitiveValueMappings.h"
46 45
47 namespace WebCore { 46 namespace WebCore {
48 47
49 TransformBuilder::TransformBuilder() 48 TransformBuilder::TransformBuilder()
50 { 49 {
51 } 50 }
52 51
53 TransformBuilder::~TransformBuilder() 52 TransformBuilder::~TransformBuilder()
54 { 53 {
55 } 54 }
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 double d = static_cast<CSSPrimitiveValue*>(transformValue->itemWitho utBoundsCheck(3))->getDoubleValue(); 281 double d = static_cast<CSSPrimitiveValue*>(transformValue->itemWitho utBoundsCheck(3))->getDoubleValue();
283 double e = zoomFactor * static_cast<CSSPrimitiveValue*>(transformVal ue->itemWithoutBoundsCheck(4))->getDoubleValue(); 282 double e = zoomFactor * static_cast<CSSPrimitiveValue*>(transformVal ue->itemWithoutBoundsCheck(4))->getDoubleValue();
284 double f = zoomFactor * static_cast<CSSPrimitiveValue*>(transformVal ue->itemWithoutBoundsCheck(5))->getDoubleValue(); 283 double f = zoomFactor * static_cast<CSSPrimitiveValue*>(transformVal ue->itemWithoutBoundsCheck(5))->getDoubleValue();
285 operations.operations().append(MatrixTransformOperation::create(a, b , c, d, e, f)); 284 operations.operations().append(MatrixTransformOperation::create(a, b , c, d, e, f));
286 break; 285 break;
287 } 286 }
288 case WebKitCSSTransformValue::Matrix3DTransformOperation: { 287 case WebKitCSSTransformValue::Matrix3DTransformOperation: {
289 if (transformValue->length() < 16) 288 if (transformValue->length() < 16)
290 break; 289 break;
291 TransformationMatrix matrix(static_cast<CSSPrimitiveValue*>(transfor mValue->itemWithoutBoundsCheck(0))->getDoubleValue(), 290 TransformationMatrix matrix(static_cast<CSSPrimitiveValue*>(transfor mValue->itemWithoutBoundsCheck(0))->getDoubleValue(),
292 static_cast<CSSPrimitiveValue*>(transformValue->i temWithoutBoundsCheck(1))->getDoubleValue(), 291 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBound sCheck(1))->getDoubleValue(),
293 static_cast<CSSPrimitiveValue*>(transformValue->i temWithoutBoundsCheck(2))->getDoubleValue(), 292 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBound sCheck(2))->getDoubleValue(),
294 static_cast<CSSPrimitiveValue*>(transformValue->i temWithoutBoundsCheck(3))->getDoubleValue(), 293 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBound sCheck(3))->getDoubleValue(),
295 static_cast<CSSPrimitiveValue*>(transformValue->i temWithoutBoundsCheck(4))->getDoubleValue(), 294 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBound sCheck(4))->getDoubleValue(),
296 static_cast<CSSPrimitiveValue*>(transformValue->i temWithoutBoundsCheck(5))->getDoubleValue(), 295 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBound sCheck(5))->getDoubleValue(),
297 static_cast<CSSPrimitiveValue*>(transformValue->i temWithoutBoundsCheck(6))->getDoubleValue(), 296 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBound sCheck(6))->getDoubleValue(),
298 static_cast<CSSPrimitiveValue*>(transformValue->i temWithoutBoundsCheck(7))->getDoubleValue(), 297 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBound sCheck(7))->getDoubleValue(),
299 static_cast<CSSPrimitiveValue*>(transformValue->i temWithoutBoundsCheck(8))->getDoubleValue(), 298 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBound sCheck(8))->getDoubleValue(),
300 static_cast<CSSPrimitiveValue*>(transformValue->i temWithoutBoundsCheck(9))->getDoubleValue(), 299 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBound sCheck(9))->getDoubleValue(),
301 static_cast<CSSPrimitiveValue*>(transformValue->i temWithoutBoundsCheck(10))->getDoubleValue(), 300 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBound sCheck(10))->getDoubleValue(),
302 static_cast<CSSPrimitiveValue*>(transformValue->i temWithoutBoundsCheck(11))->getDoubleValue(), 301 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBound sCheck(11))->getDoubleValue(),
303 zoomFactor * static_cast<CSSPrimitiveValue*>(tran sformValue->itemWithoutBoundsCheck(12))->getDoubleValue(), 302 zoomFactor * static_cast<CSSPrimitiveValue*>(transformValue->ite mWithoutBoundsCheck(12))->getDoubleValue(),
304 zoomFactor * static_cast<CSSPrimitiveValue*>(tran sformValue->itemWithoutBoundsCheck(13))->getDoubleValue(), 303 zoomFactor * static_cast<CSSPrimitiveValue*>(transformValue->ite mWithoutBoundsCheck(13))->getDoubleValue(),
305 static_cast<CSSPrimitiveValue*>(transformValue->i temWithoutBoundsCheck(14))->getDoubleValue(), 304 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBound sCheck(14))->getDoubleValue(),
306 static_cast<CSSPrimitiveValue*>(transformValue->i temWithoutBoundsCheck(15))->getDoubleValue()); 305 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBound sCheck(15))->getDoubleValue());
307 operations.operations().append(Matrix3DTransformOperation::create(ma trix)); 306 operations.operations().append(Matrix3DTransformOperation::create(ma trix));
308 break; 307 break;
309 } 308 }
310 case WebKitCSSTransformValue::PerspectiveTransformOperation: { 309 case WebKitCSSTransformValue::PerspectiveTransformOperation: {
311 Length p = Length(0, Fixed); 310 Length p = Length(0, Fixed);
312 if (firstValue->isLength()) 311 if (firstValue->isLength())
313 p = convertToFloatLength(firstValue, style, rootStyle, zoomFacto r); 312 p = convertToFloatLength(firstValue, style, rootStyle, zoomFacto r);
314 else { 313 else {
315 // This is a quirk that should go away when 3d transforms are fi nalized. 314 // This is a quirk that should go away when 3d transforms are fi nalized.
316 double val = firstValue->getDoubleValue(); 315 double val = firstValue->getDoubleValue();
(...skipping 10 matching lines...) Expand all
327 ASSERT_NOT_REACHED(); 326 ASSERT_NOT_REACHED();
328 break; 327 break;
329 } 328 }
330 } 329 }
331 330
332 outOperations = operations; 331 outOperations = operations;
333 return true; 332 return true;
334 } 333 }
335 334
336 } // namespace WebCore 335 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/TransformBuilder.h ('k') | Source/core/css/resolver/ViewportStyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698