Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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) { | |
|
bbudge
2016/05/11 17:42:19
DCHECK viewport_to_dip_scale?
oshima
2016/05/11 18:18:15
Added DCHECK_LT(0, viewport_to_dip_scale);
| |
| 98 viewport_to_dip_scale_ = viewport_to_dip_scale; | |
| 99 } | |
| 100 | |
| 97 private: | 101 private: |
| 98 PepperGraphics2DHost(RendererPpapiHost* host, | 102 PepperGraphics2DHost(RendererPpapiHost* host, |
| 99 PP_Instance instance, | 103 PP_Instance instance, |
| 100 PP_Resource resource); | 104 PP_Resource resource); |
| 101 | 105 |
| 102 bool Init(int width, | 106 bool Init(int width, |
| 103 int height, | 107 int height, |
| 104 bool is_always_opaque, | 108 bool is_always_opaque, |
| 105 scoped_refptr<PPB_ImageData_Impl> backing_store); | 109 scoped_refptr<PPB_ImageData_Impl> backing_store); |
| 106 | 110 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 bool offscreen_flush_pending_; | 200 bool offscreen_flush_pending_; |
| 197 | 201 |
| 198 // Set to true if the plugin declares that this device will always be opaque. | 202 // 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. | 203 // This allows us to do more optimized painting in some cases. |
| 200 bool is_always_opaque_; | 204 bool is_always_opaque_; |
| 201 | 205 |
| 202 // Set to the scale between what the plugin considers to be one pixel and one | 206 // Set to the scale between what the plugin considers to be one pixel and one |
| 203 // DIP | 207 // DIP |
| 204 float scale_; | 208 float scale_; |
| 205 | 209 |
| 210 // The scale between the viewport and dip. | |
| 211 float viewport_to_dip_scale_ = 1.0f; | |
| 212 | |
| 206 ppapi::host::ReplyMessageContext flush_reply_context_; | 213 ppapi::host::ReplyMessageContext flush_reply_context_; |
| 207 | 214 |
| 208 bool is_running_in_process_; | 215 bool is_running_in_process_; |
| 209 | 216 |
| 210 bool texture_mailbox_modified_; | 217 bool texture_mailbox_modified_; |
| 211 | 218 |
| 212 // This is a bitmap that was recently released by the compositor and may be | 219 // This is a bitmap that was recently released by the compositor and may be |
| 213 // used to transfer bytes to the compositor again. | 220 // used to transfer bytes to the compositor again. |
| 214 std::unique_ptr<cc::SharedBitmap> cached_bitmap_; | 221 std::unique_ptr<cc::SharedBitmap> cached_bitmap_; |
| 215 gfx::Size cached_bitmap_size_; | 222 gfx::Size cached_bitmap_size_; |
| 216 | 223 |
| 217 friend class PepperGraphics2DHostTest; | 224 friend class PepperGraphics2DHostTest; |
| 218 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost); | 225 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost); |
| 219 }; | 226 }; |
| 220 | 227 |
| 221 } // namespace content | 228 } // namespace content |
| 222 | 229 |
| 223 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ | 230 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ |
| OLD | NEW |