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

Side by Side Diff: content/renderer/pepper/pepper_compositor_host.h

Issue 1964423003: Apply viewport to dip scale to Graphics2D, Compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 7 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
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_compositor_host.cc » ('j') | no next file with comments »
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 CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_HOST_H_ 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_HOST_H_
6 #define CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_HOST_H_ 6 #define CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_HOST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // Associates this device with the given plugin instance. You can pass NULL 44 // Associates this device with the given plugin instance. You can pass NULL
45 // to clear the existing device. Returns true on success. In this case, a 45 // to clear the existing device. Returns true on success. In this case, a
46 // repaint of the page will also be scheduled. Failure means that the device 46 // repaint of the page will also be scheduled. Failure means that the device
47 // is already bound to a different instance, and nothing will happen. 47 // is already bound to a different instance, and nothing will happen.
48 bool BindToInstance(PepperPluginInstanceImpl* new_instance); 48 bool BindToInstance(PepperPluginInstanceImpl* new_instance);
49 49
50 const scoped_refptr<cc::Layer> layer() { return layer_; }; 50 const scoped_refptr<cc::Layer> layer() { return layer_; };
51 51
52 void ViewInitiatedPaint(); 52 void ViewInitiatedPaint();
53 53
54 void set_viewport_to_dip_scale(float viewport_to_dip_scale) {
55 DCHECK_LT(0, viewport_to_dip_scale_);
56 viewport_to_dip_scale_ = viewport_to_dip_scale;
57 }
58
54 private: 59 private:
55 void ImageReleased(int32_t id, 60 void ImageReleased(int32_t id,
56 std::unique_ptr<base::SharedMemory> shared_memory, 61 std::unique_ptr<base::SharedMemory> shared_memory,
57 std::unique_ptr<cc::SharedBitmap> bitmap, 62 std::unique_ptr<cc::SharedBitmap> bitmap,
58 const gpu::SyncToken& sync_token, 63 const gpu::SyncToken& sync_token,
59 bool is_lost); 64 bool is_lost);
60 void ResourceReleased(int32_t id, 65 void ResourceReleased(int32_t id,
61 const gpu::SyncToken& sync_token, 66 const gpu::SyncToken& sync_token,
62 bool is_lost); 67 bool is_lost);
63 void SendCommitLayersReplyIfNecessary(); 68 void SendCommitLayersReplyIfNecessary();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 LayerData(const LayerData& other); 100 LayerData(const LayerData& other);
96 ~LayerData(); 101 ~LayerData();
97 102
98 scoped_refptr<cc::Layer> cc_layer; 103 scoped_refptr<cc::Layer> cc_layer;
99 ppapi::CompositorLayerData pp_layer; 104 ppapi::CompositorLayerData pp_layer;
100 }; 105 };
101 std::vector<LayerData> layers_; 106 std::vector<LayerData> layers_;
102 107
103 ppapi::host::ReplyMessageContext commit_layers_reply_context_; 108 ppapi::host::ReplyMessageContext commit_layers_reply_context_;
104 109
110 // The scale between the viewport and dip. This differs in
111 // use-zoom-for-dsf mode where the content is scaled by zooming.
112 float viewport_to_dip_scale_ = 1.0f;
113
105 base::WeakPtrFactory<PepperCompositorHost> weak_factory_; 114 base::WeakPtrFactory<PepperCompositorHost> weak_factory_;
106 115
107 DISALLOW_COPY_AND_ASSIGN(PepperCompositorHost); 116 DISALLOW_COPY_AND_ASSIGN(PepperCompositorHost);
108 }; 117 };
109 118
110 } // namespace content 119 } // namespace content
111 120
112 #endif // CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_HOST_H_ 121 #endif // CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_compositor_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698