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

Side by Side Diff: Source/WebCore/rendering/RenderObject.cpp

Issue 14067007: Remove 3D_RENDERING define from Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased, retrying the bots Created 7 years, 8 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
« no previous file with comments | « Source/WebCore/rendering/RenderObject.h ('k') | Source/WebKit/chromium/features.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after
2124 RenderObject* o = parent(); 2124 RenderObject* o = parent();
2125 if (o) { 2125 if (o) {
2126 o->mapAbsoluteToLocalPoint(mode, transformState); 2126 o->mapAbsoluteToLocalPoint(mode, transformState);
2127 if (o->hasOverflowClip()) 2127 if (o->hasOverflowClip())
2128 transformState.move(toRenderBox(o)->scrolledContentOffset()); 2128 transformState.move(toRenderBox(o)->scrolledContentOffset());
2129 } 2129 }
2130 } 2130 }
2131 2131
2132 bool RenderObject::shouldUseTransformFromContainer(const RenderObject* container Object) const 2132 bool RenderObject::shouldUseTransformFromContainer(const RenderObject* container Object) const
2133 { 2133 {
2134 #if ENABLE(3D_RENDERING)
2135 // hasTransform() indicates whether the object has transform, transform-styl e or perspective. We just care about transform, 2134 // hasTransform() indicates whether the object has transform, transform-styl e or perspective. We just care about transform,
2136 // so check the layer's transform directly. 2135 // so check the layer's transform directly.
2137 return (hasLayer() && toRenderLayerModelObject(this)->layer()->transform()) || (containerObject && containerObject->style()->hasPerspective()); 2136 return (hasLayer() && toRenderLayerModelObject(this)->layer()->transform()) || (containerObject && containerObject->style()->hasPerspective());
2138 #else
2139 UNUSED_PARAM(containerObject);
2140 return hasTransform();
2141 #endif
2142 } 2137 }
2143 2138
2144 void RenderObject::getTransformFromContainer(const RenderObject* containerObject , const LayoutSize& offsetInContainer, TransformationMatrix& transform) const 2139 void RenderObject::getTransformFromContainer(const RenderObject* containerObject , const LayoutSize& offsetInContainer, TransformationMatrix& transform) const
2145 { 2140 {
2146 transform.makeIdentity(); 2141 transform.makeIdentity();
2147 transform.translate(offsetInContainer.width(), offsetInContainer.height()); 2142 transform.translate(offsetInContainer.width(), offsetInContainer.height());
2148 RenderLayer* layer; 2143 RenderLayer* layer;
2149 if (hasLayer() && (layer = toRenderLayerModelObject(this)->layer()) && layer ->transform()) 2144 if (hasLayer() && (layer = toRenderLayerModelObject(this)->layer()) && layer ->transform())
2150 transform.multiply(layer->currentTransform()); 2145 transform.multiply(layer->currentTransform());
2151 2146
2152 #if ENABLE(3D_RENDERING)
2153 if (containerObject && containerObject->hasLayer() && containerObject->style ()->hasPerspective()) { 2147 if (containerObject && containerObject->hasLayer() && containerObject->style ()->hasPerspective()) {
2154 // Perpsective on the container affects us, so we have to factor it in h ere. 2148 // Perpsective on the container affects us, so we have to factor it in h ere.
2155 ASSERT(containerObject->hasLayer()); 2149 ASSERT(containerObject->hasLayer());
2156 FloatPoint perspectiveOrigin = toRenderLayerModelObject(containerObject) ->layer()->perspectiveOrigin(); 2150 FloatPoint perspectiveOrigin = toRenderLayerModelObject(containerObject) ->layer()->perspectiveOrigin();
2157 2151
2158 TransformationMatrix perspectiveMatrix; 2152 TransformationMatrix perspectiveMatrix;
2159 perspectiveMatrix.applyPerspective(containerObject->style()->perspective ()); 2153 perspectiveMatrix.applyPerspective(containerObject->style()->perspective ());
2160 2154
2161 transform.translateRight3d(-perspectiveOrigin.x(), -perspectiveOrigin.y( ), 0); 2155 transform.translateRight3d(-perspectiveOrigin.x(), -perspectiveOrigin.y( ), 0);
2162 transform = perspectiveMatrix * transform; 2156 transform = perspectiveMatrix * transform;
2163 transform.translateRight3d(perspectiveOrigin.x(), perspectiveOrigin.y(), 0); 2157 transform.translateRight3d(perspectiveOrigin.x(), perspectiveOrigin.y(), 0);
2164 } 2158 }
2165 #else
2166 UNUSED_PARAM(containerObject);
2167 #endif
2168 } 2159 }
2169 2160
2170 FloatQuad RenderObject::localToContainerQuad(const FloatQuad& localQuad, const R enderLayerModelObject* repaintContainer, MapCoordinatesFlags mode, bool* wasFixe d) const 2161 FloatQuad RenderObject::localToContainerQuad(const FloatQuad& localQuad, const R enderLayerModelObject* repaintContainer, MapCoordinatesFlags mode, bool* wasFixe d) const
2171 { 2162 {
2172 // Track the point at the center of the quad's bounding box. As mapLocalToCo ntainer() calls offsetFromContainer(), 2163 // Track the point at the center of the quad's bounding box. As mapLocalToCo ntainer() calls offsetFromContainer(),
2173 // it will use that point as the reference point to decide which column's tr ansform to apply in multiple-column blocks. 2164 // it will use that point as the reference point to decide which column's tr ansform to apply in multiple-column blocks.
2174 TransformState transformState(TransformState::ApplyTransformDirection, local Quad.boundingBox().center(), localQuad); 2165 TransformState transformState(TransformState::ApplyTransformDirection, local Quad.boundingBox().center(), localQuad);
2175 mapLocalToContainer(repaintContainer, transformState, mode | ApplyContainerF lip | UseTransforms, wasFixed); 2166 mapLocalToContainer(repaintContainer, transformState, mode | ApplyContainerF lip | UseTransforms, wasFixed);
2176 transformState.flatten(); 2167 transformState.flatten();
2177 2168
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
3163 { 3154 {
3164 if (object1) { 3155 if (object1) {
3165 const WebCore::RenderObject* root = object1; 3156 const WebCore::RenderObject* root = object1;
3166 while (root->parent()) 3157 while (root->parent())
3167 root = root->parent(); 3158 root = root->parent();
3168 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3159 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3169 } 3160 }
3170 } 3161 }
3171 3162
3172 #endif 3163 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderObject.h ('k') | Source/WebKit/chromium/features.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698