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

Side by Side Diff: content/renderer/pepper/pepper_graphics_2d_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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_GRAPHICS_2D_HOST_H_ 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_
6 #define CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ 6 #define CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 void SetScale(float scale); 88 void SetScale(float scale);
89 float GetScale() const; 89 float GetScale() const;
90 void SetLayerTransform(float scale, const PP_Point& transform); 90 void SetLayerTransform(float scale, const PP_Point& transform);
91 bool IsAlwaysOpaque() const; 91 bool IsAlwaysOpaque() const;
92 PPB_ImageData_Impl* ImageData(); 92 PPB_ImageData_Impl* ImageData();
93 gfx::Size Size() const; 93 gfx::Size Size() const;
94 94
95 void ClearCache(); 95 void ClearCache();
96 96
97 void set_viewport_to_dip_scale(float viewport_to_dip_scale) {
98 DCHECK_LT(0, viewport_to_dip_scale_);
99 viewport_to_dip_scale_ = viewport_to_dip_scale;
100 }
101
97 private: 102 private:
98 PepperGraphics2DHost(RendererPpapiHost* host, 103 PepperGraphics2DHost(RendererPpapiHost* host,
99 PP_Instance instance, 104 PP_Instance instance,
100 PP_Resource resource); 105 PP_Resource resource);
101 106
102 bool Init(int width, 107 bool Init(int width,
103 int height, 108 int height,
104 bool is_always_opaque, 109 bool is_always_opaque,
105 scoped_refptr<PPB_ImageData_Impl> backing_store); 110 scoped_refptr<PPB_ImageData_Impl> backing_store);
106 111
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 bool offscreen_flush_pending_; 201 bool offscreen_flush_pending_;
197 202
198 // Set to true if the plugin declares that this device will always be opaque. 203 // Set to true if the plugin declares that this device will always be opaque.
199 // This allows us to do more optimized painting in some cases. 204 // This allows us to do more optimized painting in some cases.
200 bool is_always_opaque_; 205 bool is_always_opaque_;
201 206
202 // Set to the scale between what the plugin considers to be one pixel and one 207 // Set to the scale between what the plugin considers to be one pixel and one
203 // DIP 208 // DIP
204 float scale_; 209 float scale_;
205 210
211 // The scale between the viewport and dip.
212 float viewport_to_dip_scale_ = 1.0f;
213
206 ppapi::host::ReplyMessageContext flush_reply_context_; 214 ppapi::host::ReplyMessageContext flush_reply_context_;
207 215
208 bool is_running_in_process_; 216 bool is_running_in_process_;
209 217
210 bool texture_mailbox_modified_; 218 bool texture_mailbox_modified_;
211 219
212 // This is a bitmap that was recently released by the compositor and may be 220 // This is a bitmap that was recently released by the compositor and may be
213 // used to transfer bytes to the compositor again. 221 // used to transfer bytes to the compositor again.
214 std::unique_ptr<cc::SharedBitmap> cached_bitmap_; 222 std::unique_ptr<cc::SharedBitmap> cached_bitmap_;
215 gfx::Size cached_bitmap_size_; 223 gfx::Size cached_bitmap_size_;
216 224
217 friend class PepperGraphics2DHostTest; 225 friend class PepperGraphics2DHostTest;
218 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost); 226 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost);
219 }; 227 };
220 228
221 } // namespace content 229 } // namespace content
222 230
223 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ 231 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_compositor_host.cc ('k') | content/renderer/pepper/pepper_graphics_2d_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698