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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2769793002: Implement CSS: scroll-boundary-behavior (Closed)
Patch Set: Use only gpuBenchmarking. Created 3 years, 6 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, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 #include "platform/graphics/GraphicsContext.h" 73 #include "platform/graphics/GraphicsContext.h"
74 #include "platform/graphics/paint/ClipDisplayItem.h" 74 #include "platform/graphics/paint/ClipDisplayItem.h"
75 #include "platform/graphics/paint/CullRect.h" 75 #include "platform/graphics/paint/CullRect.h"
76 #include "platform/graphics/paint/DrawingRecorder.h" 76 #include "platform/graphics/paint/DrawingRecorder.h"
77 #include "platform/graphics/paint/PaintController.h" 77 #include "platform/graphics/paint/PaintController.h"
78 #include "platform/graphics/paint/PaintRecordBuilder.h" 78 #include "platform/graphics/paint/PaintRecordBuilder.h"
79 #include "platform/graphics/paint/TransformDisplayItem.h" 79 #include "platform/graphics/paint/TransformDisplayItem.h"
80 #include "platform/wtf/CurrentTime.h" 80 #include "platform/wtf/CurrentTime.h"
81 #include "platform/wtf/text/StringBuilder.h" 81 #include "platform/wtf/text/StringBuilder.h"
82 #include "public/platform/WebLayerStickyPositionConstraint.h" 82 #include "public/platform/WebLayerStickyPositionConstraint.h"
83 #include "public/platform/WebScrollBoundaryBehavior.h"
83 84
84 namespace blink { 85 namespace blink {
85 86
86 using namespace HTMLNames; 87 using namespace HTMLNames;
87 88
88 static IntRect ClipBox(LayoutBox& layout_object); 89 static IntRect ClipBox(LayoutBox& layout_object);
89 90
90 static IntRect ContentsRect(const LayoutObject& layout_object) { 91 static IntRect ContentsRect(const LayoutObject& layout_object) {
91 if (!layout_object.IsBox()) 92 if (!layout_object.IsBox())
92 return IntRect(); 93 return IntRect();
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 UpdateDrawsContent(); 1156 UpdateDrawsContent();
1156 UpdateElementIdAndCompositorMutableProperties(); 1157 UpdateElementIdAndCompositorMutableProperties();
1157 UpdateBackgroundPaintsOntoScrollingContentsLayer(); 1158 UpdateBackgroundPaintsOntoScrollingContentsLayer();
1158 UpdateContentsOpaque(); 1159 UpdateContentsOpaque();
1159 UpdateRasterizationPolicy(); 1160 UpdateRasterizationPolicy();
1160 UpdateAfterPartResize(); 1161 UpdateAfterPartResize();
1161 UpdateRenderingContext(); 1162 UpdateRenderingContext();
1162 UpdateShouldFlattenTransform(); 1163 UpdateShouldFlattenTransform();
1163 UpdateChildrenTransform(); 1164 UpdateChildrenTransform();
1164 UpdateScrollParent(ScrollParent()); 1165 UpdateScrollParent(ScrollParent());
1166 UpdateScrollBoundaryBehavior();
1165 RegisterScrollingLayers(); 1167 RegisterScrollingLayers();
1166 1168
1167 UpdateCompositingReasons(); 1169 UpdateCompositingReasons();
1168 } 1170 }
1169 1171
1172 void CompositedLayerMapping::UpdateScrollBoundaryBehavior() {
1173 EScrollBoundaryBehavior behavior_x =
1174 GetLayoutObject().StyleRef().ScrollBoundaryBehaviorX();
1175 EScrollBoundaryBehavior behavior_y =
1176 GetLayoutObject().StyleRef().ScrollBoundaryBehaviorY();
1177 if (scrolling_contents_layer_) {
1178 using ScrollBoundaryBehavior =
1179 WebScrollBoundaryBehavior::ScrollBoundaryBehaviorType;
1180 scrolling_contents_layer_->SetScrollBoundaryBehavior(
1181 WebScrollBoundaryBehavior(
1182 static_cast<ScrollBoundaryBehavior>(behavior_x),
1183 static_cast<ScrollBoundaryBehavior>(behavior_y)));
1184 }
1185 }
1186
1170 void CompositedLayerMapping::UpdateMainGraphicsLayerGeometry( 1187 void CompositedLayerMapping::UpdateMainGraphicsLayerGeometry(
1171 const IntRect& relative_compositing_bounds, 1188 const IntRect& relative_compositing_bounds,
1172 const IntRect& local_compositing_bounds, 1189 const IntRect& local_compositing_bounds,
1173 const IntPoint& graphics_layer_parent_location) { 1190 const IntPoint& graphics_layer_parent_location) {
1174 graphics_layer_->SetPosition(FloatPoint( 1191 graphics_layer_->SetPosition(FloatPoint(
1175 relative_compositing_bounds.Location() - graphics_layer_parent_location)); 1192 relative_compositing_bounds.Location() - graphics_layer_parent_location));
1176 graphics_layer_->SetOffsetFromLayoutObject( 1193 graphics_layer_->SetOffsetFromLayoutObject(
1177 ToIntSize(local_compositing_bounds.Location())); 1194 ToIntSize(local_compositing_bounds.Location()));
1178 1195
1179 FloatSize old_size = graphics_layer_->Size(); 1196 FloatSize old_size = graphics_layer_->Size();
(...skipping 2482 matching lines...) Expand 10 before | Expand all | Expand 10 after
3662 } else if (graphics_layer == decoration_outline_layer_.get()) { 3679 } else if (graphics_layer == decoration_outline_layer_.get()) {
3663 name = "Decoration Layer"; 3680 name = "Decoration Layer";
3664 } else { 3681 } else {
3665 NOTREACHED(); 3682 NOTREACHED();
3666 } 3683 }
3667 3684
3668 return name; 3685 return name;
3669 } 3686 }
3670 3687
3671 } // namespace blink 3688 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698