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

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

Issue 61813003: Allow PPB_ImageData_Impl to be created in a way that is compatible with unittests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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 <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 19 matching lines...) Expand all
30 namespace content { 30 namespace content {
31 31
32 class PepperPluginInstanceImpl; 32 class PepperPluginInstanceImpl;
33 class PPB_ImageData_Impl; 33 class PPB_ImageData_Impl;
34 class RendererPpapiHost; 34 class RendererPpapiHost;
35 35
36 class CONTENT_EXPORT PepperGraphics2DHost 36 class CONTENT_EXPORT PepperGraphics2DHost
37 : public ppapi::host::ResourceHost, 37 : public ppapi::host::ResourceHost,
38 public base::SupportsWeakPtr<PepperGraphics2DHost> { 38 public base::SupportsWeakPtr<PepperGraphics2DHost> {
39 public: 39 public:
40 static PepperGraphics2DHost* Create(RendererPpapiHost* host, 40 static PepperGraphics2DHost* Create(
41 PP_Instance instance, 41 RendererPpapiHost* host,
42 PP_Resource resource, 42 PP_Instance instance,
43 const PP_Size& size, 43 PP_Resource resource,
44 PP_Bool is_always_opaque); 44 const PP_Size& size,
45 PP_Bool is_always_opaque,
46 scoped_refptr<PPB_ImageData_Impl> backing_store);
45 47
46 virtual ~PepperGraphics2DHost(); 48 virtual ~PepperGraphics2DHost();
47 49
48 // ppapi::host::ResourceHost override. 50 // ppapi::host::ResourceHost override.
49 virtual int32_t OnResourceMessageReceived( 51 virtual int32_t OnResourceMessageReceived(
50 const IPC::Message& msg, 52 const IPC::Message& msg,
51 ppapi::host::HostMessageContext* context) OVERRIDE; 53 ppapi::host::HostMessageContext* context) OVERRIDE;
52 virtual bool IsGraphics2DHost() OVERRIDE; 54 virtual bool IsGraphics2DHost() OVERRIDE;
53 55
54 bool ReadImageData(PP_Resource image, 56 bool ReadImageData(PP_Resource image,
(...skipping 24 matching lines...) Expand all
79 PPB_ImageData_Impl* ImageData(); 81 PPB_ImageData_Impl* ImageData();
80 gfx::Size Size() const; 82 gfx::Size Size() const;
81 83
82 gfx::Point plugin_offset() const { return plugin_offset_; } 84 gfx::Point plugin_offset() const { return plugin_offset_; }
83 85
84 private: 86 private:
85 PepperGraphics2DHost(RendererPpapiHost* host, 87 PepperGraphics2DHost(RendererPpapiHost* host,
86 PP_Instance instance, 88 PP_Instance instance,
87 PP_Resource resource); 89 PP_Resource resource);
88 90
89 bool Init(int width, int height, bool is_always_opaque); 91 bool Init(int width,
92 int height,
93 bool is_always_opaque,
94 scoped_refptr<PPB_ImageData_Impl> backing_store);
90 95
91 int32_t OnHostMsgPaintImageData(ppapi::host::HostMessageContext* context, 96 int32_t OnHostMsgPaintImageData(ppapi::host::HostMessageContext* context,
92 const ppapi::HostResource& image_data, 97 const ppapi::HostResource& image_data,
93 const PP_Point& top_left, 98 const PP_Point& top_left,
94 bool src_rect_specified, 99 bool src_rect_specified,
95 const PP_Rect& src_rect); 100 const PP_Rect& src_rect);
96 int32_t OnHostMsgScroll(ppapi::host::HostMessageContext* context, 101 int32_t OnHostMsgScroll(ppapi::host::HostMessageContext* context,
97 bool clip_specified, 102 bool clip_specified,
98 const PP_Rect& clip, 103 const PP_Rect& clip,
99 const PP_Point& amount); 104 const PP_Point& amount);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // graphics context. 193 // graphics context.
189 gfx::Point plugin_offset_; 194 gfx::Point plugin_offset_;
190 195
191 friend class PepperGraphics2DHostTest; 196 friend class PepperGraphics2DHostTest;
192 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost); 197 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost);
193 }; 198 };
194 199
195 } // namespace content 200 } // namespace content
196 201
197 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ 202 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698