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

Side by Side Diff: webkit/compositor_bindings/web_layer_impl_fixed_bounds.h

Issue 12326022: Efficiently handle image layer scaling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add black-box tests Created 7 years, 10 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
(Empty)
1 // Copyright 2013 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 WebLayerImplFixedBounds_h
6 #define WebLayerImplFixedBounds_h
7
8 #include "ui/gfx/size.h"
9 #include "ui/gfx/transform.h"
10 #include "webkit/compositor_bindings/web_layer_impl.h"
11
12 namespace WebKit {
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 WEBKIT_COMPOSITOR_BINDINGS_EXPORT WebLayerImplFixedBounds();
22 WEBKIT_COMPOSITOR_BINDINGS_EXPORT explicit WebLayerImplFixedBounds(scoped_re fptr<cc::Layer>);
23 virtual ~WebLayerImplFixedBounds();
24
25 // WebLayerImpl overrides.
26 virtual void invalidateRect(const WebFloatRect&) OVERRIDE;
27 virtual void setAnchorPoint(const WebFloatPoint&) OVERRIDE;
28 virtual void setBounds(const WebSize&) OVERRIDE;
29 virtual WebSize bounds() const OVERRIDE;
30 virtual void setSublayerTransform(const SkMatrix44&) OVERRIDE;
31 virtual void setSublayerTransform(const WebTransformationMatrix&) OVERRIDE;
32 virtual SkMatrix44 sublayerTransform() const OVERRIDE;
33 virtual void setTransform(const SkMatrix44&) OVERRIDE;
34 virtual void setTransform(const WebTransformationMatrix&) OVERRIDE;
35 virtual SkMatrix44 transform() const OVERRIDE;
36
37 WEBKIT_COMPOSITOR_BINDINGS_EXPORT void setFixedBounds(const gfx::Size& fixed Bounds);
38
39 protected:
40 void setTransformInternal(const gfx::Transform&);
41 void setSublayerTransformInternal(const gfx::Transform&);
42 void updateLayerBoundsAndTransform();
43
44 gfx::Transform m_originalSublayerTransform;
45 gfx::Transform m_originalTransform;
46 gfx::Size m_originalBounds;
47 gfx::Size m_fixedBounds;
48 };
49
50 } // namespace WebKit
51
52 #endif // WebLayerImplFixedBounds_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698