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

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: 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
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) {
bbudge 2016/05/11 17:42:19 DCHECK here for viewport_to_dip_scale != 0?
oshima 2016/05/11 18:18:15 Added DCHECK_LT(0, viewport_to_dip_scale);
55 viewport_to_dip_scale_ = viewport_to_dip_scale;
56 }
57
54 private: 58 private:
55 void ImageReleased(int32_t id, 59 void ImageReleased(int32_t id,
56 std::unique_ptr<base::SharedMemory> shared_memory, 60 std::unique_ptr<base::SharedMemory> shared_memory,
57 std::unique_ptr<cc::SharedBitmap> bitmap, 61 std::unique_ptr<cc::SharedBitmap> bitmap,
58 const gpu::SyncToken& sync_token, 62 const gpu::SyncToken& sync_token,
59 bool is_lost); 63 bool is_lost);
60 void ResourceReleased(int32_t id, 64 void ResourceReleased(int32_t id,
61 const gpu::SyncToken& sync_token, 65 const gpu::SyncToken& sync_token,
62 bool is_lost); 66 bool is_lost);
63 void SendCommitLayersReplyIfNecessary(); 67 void SendCommitLayersReplyIfNecessary();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 LayerData(const LayerData& other); 99 LayerData(const LayerData& other);
96 ~LayerData(); 100 ~LayerData();
97 101
98 scoped_refptr<cc::Layer> cc_layer; 102 scoped_refptr<cc::Layer> cc_layer;
99 ppapi::CompositorLayerData pp_layer; 103 ppapi::CompositorLayerData pp_layer;
100 }; 104 };
101 std::vector<LayerData> layers_; 105 std::vector<LayerData> layers_;
102 106
103 ppapi::host::ReplyMessageContext commit_layers_reply_context_; 107 ppapi::host::ReplyMessageContext commit_layers_reply_context_;
104 108
109 // The scale between the viewport and dip. This differs in
110 // use-zoom-for-dsf mode where the content is scaled by zooming.
111 float viewport_to_dip_scale_ = 1.0f;
112
105 base::WeakPtrFactory<PepperCompositorHost> weak_factory_; 113 base::WeakPtrFactory<PepperCompositorHost> weak_factory_;
106 114
107 DISALLOW_COPY_AND_ASSIGN(PepperCompositorHost); 115 DISALLOW_COPY_AND_ASSIGN(PepperCompositorHost);
108 }; 116 };
109 117
110 } // namespace content 118 } // namespace content
111 119
112 #endif // CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_HOST_H_ 120 #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') | content/renderer/pepper/pepper_graphics_2d_host.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698