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

Side by Side Diff: cc/layers/surface_layer.h

Issue 719573003: Explicitly specify contents scale for SurfaceLayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 | « no previous file | cc/layers/surface_layer.cc » ('j') | ui/compositor/layer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_LAYERS_SURFACE_LAYER_H_ 5 #ifndef CC_LAYERS_SURFACE_LAYER_H_
6 #define CC_LAYERS_SURFACE_LAYER_H_ 6 #define CC_LAYERS_SURFACE_LAYER_H_
7 7
8 #include "cc/base/cc_export.h" 8 #include "cc/base/cc_export.h"
9 #include "cc/layers/layer.h" 9 #include "cc/layers/layer.h"
10 #include "cc/surfaces/surface_id.h" 10 #include "cc/surfaces/surface_id.h"
(...skipping 12 matching lines...) Expand all
23 using SatisfyCallback = base::Callback<void(SurfaceSequence)>; 23 using SatisfyCallback = base::Callback<void(SurfaceSequence)>;
24 24
25 // This callback is run to require that a specific SurfaceSequence is 25 // This callback is run to require that a specific SurfaceSequence is
26 // received before a SurfaceId is destroyed. 26 // received before a SurfaceId is destroyed.
27 using RequireCallback = base::Callback<void(SurfaceId, SurfaceSequence)>; 27 using RequireCallback = base::Callback<void(SurfaceId, SurfaceSequence)>;
28 28
29 static scoped_refptr<SurfaceLayer> Create( 29 static scoped_refptr<SurfaceLayer> Create(
30 const SatisfyCallback& satisfy_callback, 30 const SatisfyCallback& satisfy_callback,
31 const RequireCallback& require_callback); 31 const RequireCallback& require_callback);
32 32
33 void SetSurfaceId(SurfaceId surface_id, const gfx::Size& size); 33 void SetSurfaceId(SurfaceId surface_id, float scale, const gfx::Size& size);
34 34
35 // Layer overrides. 35 // Layer overrides.
36 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; 36 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
37 void SetLayerTreeHost(LayerTreeHost* host) override; 37 void SetLayerTreeHost(LayerTreeHost* host) override;
38 void PushPropertiesTo(LayerImpl* layer) override; 38 void PushPropertiesTo(LayerImpl* layer) override;
39 void CalculateContentsScale(float ideal_contents_scale, 39 void CalculateContentsScale(float ideal_contents_scale,
40 float* contents_scale_x, 40 float* contents_scale_x,
41 float* contents_scale_y, 41 float* contents_scale_y,
42 gfx::Size* content_bounds) override; 42 gfx::Size* content_bounds) override;
43 43
44 protected: 44 protected:
45 SurfaceLayer(const SatisfyCallback& satisfy_callback, 45 SurfaceLayer(const SatisfyCallback& satisfy_callback,
46 const RequireCallback& require_callback); 46 const RequireCallback& require_callback);
47 bool HasDrawableContent() const override; 47 bool HasDrawableContent() const override;
48 48
49 private: 49 private:
50 ~SurfaceLayer() override; 50 ~SurfaceLayer() override;
51 void CreateNewDestroySequence(); 51 void CreateNewDestroySequence();
52 void SatisfyDestroySequence(); 52 void SatisfyDestroySequence();
53 53
54 SurfaceId surface_id_; 54 SurfaceId surface_id_;
55 gfx::Size surface_size_; 55 gfx::Size surface_size_;
56 float surface_scale_;
56 SurfaceSequence destroy_sequence_; 57 SurfaceSequence destroy_sequence_;
57 SatisfyCallback satisfy_callback_; 58 SatisfyCallback satisfy_callback_;
58 RequireCallback require_callback_; 59 RequireCallback require_callback_;
59 60
60 DISALLOW_COPY_AND_ASSIGN(SurfaceLayer); 61 DISALLOW_COPY_AND_ASSIGN(SurfaceLayer);
61 }; 62 };
62 63
63 } // namespace cc 64 } // namespace cc
64 65
65 #endif // CC_LAYERS_SURFACE_LAYER_H_ 66 #endif // CC_LAYERS_SURFACE_LAYER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/layers/surface_layer.cc » ('j') | ui/compositor/layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698