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: sky/viewer/cc/web_layer_impl_fixed_bounds.h

Issue 752683002: Break Sky's dependency on cc (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « sky/viewer/cc/web_layer_impl.cc ('k') | sky/viewer/cc/web_layer_impl_fixed_bounds.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SKY_VIEWER_CC_WEB_LAYER_IMPL_FIXED_BOUNDS_H_
6 #define SKY_VIEWER_CC_WEB_LAYER_IMPL_FIXED_BOUNDS_H_
7
8 #include "sky/viewer/cc/web_layer_impl.h"
9 #include "ui/gfx/size.h"
10 #include "ui/gfx/transform.h"
11
12 namespace sky_viewer_cc {
13
14 // A special implementation of WebLayerImpl for layers that its contents
15 // need to be automatically scaled when the bounds changes. The compositor
16 // can efficiently handle the bounds change of such layers if the bounds
17 // is fixed to a given value and the change of bounds are converted to
18 // transformation scales.
19 class WebLayerImplFixedBounds : public WebLayerImpl {
20 public:
21 SKY_VIEWER_CC_EXPORT WebLayerImplFixedBounds();
22 SKY_VIEWER_CC_EXPORT explicit WebLayerImplFixedBounds(scoped_refptr<cc::Layer> );
23 virtual ~WebLayerImplFixedBounds();
24
25 // WebLayerImpl overrides.
26 virtual void invalidateRect(const blink::WebFloatRect& rect);
27 virtual void setTransformOrigin(
28 const blink::WebFloatPoint3D& transform_origin);
29 virtual void setBounds(const blink::WebSize& bounds);
30 virtual blink::WebSize bounds() const;
31 virtual void setTransform(const SkMatrix44& transform);
32 virtual SkMatrix44 transform() const;
33
34 SKY_VIEWER_CC_EXPORT void SetFixedBounds(gfx::Size bounds);
35
36 protected:
37 void SetTransformInternal(const gfx::Transform& transform);
38 void UpdateLayerBoundsAndTransform();
39
40 gfx::Transform original_transform_;
41 gfx::Size original_bounds_;
42 gfx::Size fixed_bounds_;
43
44 private:
45 DISALLOW_COPY_AND_ASSIGN(WebLayerImplFixedBounds);
46 };
47
48 } // namespace sky_viewer_cc
49
50 #endif // SKY_VIEWER_CC_WEB_LAYER_IMPL_FIXED_BOUNDS_H_
OLDNEW
« no previous file with comments | « sky/viewer/cc/web_layer_impl.cc ('k') | sky/viewer/cc/web_layer_impl_fixed_bounds.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698