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

Side by Side Diff: public/platform/WebLayer.h

Issue 1308273010: Adapt and reland old position sticky implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix style errors and remaining layout tests. Created 5 years, 3 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 14 matching lines...) Expand all
25 25
26 #ifndef WebLayer_h 26 #ifndef WebLayer_h
27 #define WebLayer_h 27 #define WebLayer_h
28 28
29 #include "WebBlendMode.h" 29 #include "WebBlendMode.h"
30 #include "WebColor.h" 30 #include "WebColor.h"
31 #include "WebCommon.h" 31 #include "WebCommon.h"
32 #include "WebCompositorAnimation.h" 32 #include "WebCompositorAnimation.h"
33 #include "WebDoublePoint.h" 33 #include "WebDoublePoint.h"
34 #include "WebFloatPoint3D.h" 34 #include "WebFloatPoint3D.h"
35 #include "WebLayerPositionConstraint.h"
35 #include "WebPoint.h" 36 #include "WebPoint.h"
36 #include "WebRect.h" 37 #include "WebRect.h"
37 #include "WebScrollBlocksOn.h" 38 #include "WebScrollBlocksOn.h"
38 #include "WebSize.h" 39 #include "WebSize.h"
39 #include "WebString.h" 40 #include "WebString.h"
40 #include "WebVector.h" 41 #include "WebVector.h"
41 42
42 class SkMatrix44; 43 class SkMatrix44;
43 class SkImageFilter; 44 class SkImageFilter;
44 45
45 namespace blink { 46 namespace blink {
46 class WebCompositorAnimationDelegate; 47 class WebCompositorAnimationDelegate;
47 class WebFilterOperations; 48 class WebFilterOperations;
48 class WebLayerClient; 49 class WebLayerClient;
49 class WebLayerScrollClient; 50 class WebLayerScrollClient;
50 struct WebFloatPoint; 51 struct WebFloatPoint;
51 struct WebLayerPositionConstraint; 52 struct WebLayerPositionConstraint;
53 struct WebLayerStickyPositionConstraint;
52 54
53 class WebLayer { 55 class WebLayer {
54 public: 56 public:
55 virtual ~WebLayer() { } 57 virtual ~WebLayer() { }
56 58
57 // Returns a positive ID that will be unique across all WebLayers allocated in this process. 59 // Returns a positive ID that will be unique across all WebLayers allocated in this process.
58 virtual int id() const = 0; 60 virtual int id() const = 0;
59 61
60 // Sets a region of the layer as invalid, i.e. needs to update its content. 62 // Sets a region of the layer as invalid, i.e. needs to update its content.
61 virtual void invalidateRect(const WebRect&) = 0; 63 virtual void invalidateRect(const WebRect&) = 0;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 virtual WebScrollBlocksOn scrollBlocksOn() const { return WebScrollBlocksOnN one; } 215 virtual WebScrollBlocksOn scrollBlocksOn() const { return WebScrollBlocksOnN one; }
214 216
215 virtual void setIsContainerForFixedPositionLayers(bool) = 0; 217 virtual void setIsContainerForFixedPositionLayers(bool) = 0;
216 virtual bool isContainerForFixedPositionLayers() const = 0; 218 virtual bool isContainerForFixedPositionLayers() const = 0;
217 219
218 // This function sets layer position constraint. The constraint will be used 220 // This function sets layer position constraint. The constraint will be used
219 // to adjust layer position during threaded scrolling. 221 // to adjust layer position during threaded scrolling.
220 virtual void setPositionConstraint(const WebLayerPositionConstraint&) = 0; 222 virtual void setPositionConstraint(const WebLayerPositionConstraint&) = 0;
221 virtual WebLayerPositionConstraint positionConstraint() const = 0; 223 virtual WebLayerPositionConstraint positionConstraint() const = 0;
222 224
225 // FIXME: Make pure once cc is updated.
226 virtual void setStickyPositionConstraint(const WebLayerStickyPositionConstra int&) { };
227 virtual WebLayerStickyPositionConstraint stickyPositionConstraint() const { return WebLayerStickyPositionConstraint(); }
228
223 // The scroll client is notified when the scroll position of the WebLayer 229 // The scroll client is notified when the scroll position of the WebLayer
224 // changes. Only a single scroll client can be set for a WebLayer at a time. 230 // changes. Only a single scroll client can be set for a WebLayer at a time.
225 // The WebLayer does not take ownership of the scroll client, and it is the 231 // The WebLayer does not take ownership of the scroll client, and it is the
226 // responsibility of the client to reset the layer's scroll client before 232 // responsibility of the client to reset the layer's scroll client before
227 // deleting the scroll client. 233 // deleting the scroll client.
228 virtual void setScrollClient(WebLayerScrollClient*) = 0; 234 virtual void setScrollClient(WebLayerScrollClient*) = 0;
229 235
230 // Forces this layer to use a render surface. There is no benefit in doing 236 // Forces this layer to use a render surface. There is no benefit in doing
231 // so, but this is to facilitate benchmarks and tests. 237 // so, but this is to facilitate benchmarks and tests.
232 virtual void setForceRenderSurface(bool) = 0; 238 virtual void setForceRenderSurface(bool) = 0;
233 239
234 // True if the layer is not part of a tree attached to a WebLayerTreeView. 240 // True if the layer is not part of a tree attached to a WebLayerTreeView.
235 virtual bool isOrphan() const = 0; 241 virtual bool isOrphan() const = 0;
236 242
237 virtual void setWebLayerClient(WebLayerClient*) = 0; 243 virtual void setWebLayerClient(WebLayerClient*) = 0;
238 }; 244 };
239 245
240 } // namespace blink 246 } // namespace blink
241 247
242 #endif // WebLayer_h 248 #endif // WebLayer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698