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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin_compositing_helper.h

Issue 11967013: Fixes issues when switching between software and compositing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 11 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_BROWSER_PLUGIN_BROWSER_PLUGIN_COMPOSITING_HELPER_H_ 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_COMPOSITING_HELPER_H_
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_COMPOSITING_HELPER_H_ 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_COMPOSITING_HELPER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "ui/gfx/size.h" 13 #include "ui/gfx/size.h"
14 14
15 namespace cc { 15 namespace cc {
16 class TextureLayer; 16 class TextureLayer;
17 } 17 }
18 18
19 namespace WebKit { 19 namespace WebKit {
20 class WebPluginContainer; 20 class WebPluginContainer;
21 class WebLayer; 21 class WebLayer;
22 } 22 }
23 23
24 namespace content { 24 namespace content {
25 25
26 class CONTENT_EXPORT BrowserPluginCompositingHelper { 26 class BrowserPluginManager;
27
28 class CONTENT_EXPORT BrowserPluginCompositingHelper :
29 public base::RefCounted<BrowserPluginCompositingHelper> {
27 public: 30 public:
28 BrowserPluginCompositingHelper(WebKit::WebPluginContainer* container, 31 BrowserPluginCompositingHelper(WebKit::WebPluginContainer* container,
32 BrowserPluginManager* manager,
29 int host_routing_id); 33 int host_routing_id);
30 ~BrowserPluginCompositingHelper();
31
32 void EnableCompositing(bool); 34 void EnableCompositing(bool);
35 void OnContainerDestroy();
33 void OnBuffersSwapped(const gfx::Size& size, 36 void OnBuffersSwapped(const gfx::Size& size,
34 const std::string& mailbox_name, 37 const std::string& mailbox_name,
35 int gpu_route_id, 38 int gpu_route_id,
36 int gpu_host_id); 39 int gpu_host_id);
37 void SetContainerSize(const gfx::Size&); 40 void SetContainerSize(const gfx::Size&);
38 41 protected:
42 // Friend RefCounted so that the dtor can be non-public.
43 friend class base::RefCounted<BrowserPluginCompositingHelper>;
39 private: 44 private:
45 ~BrowserPluginCompositingHelper();
46 void FreeMailboxMemory(const std::string& mailbox_name,
47 unsigned sync_point);
48 void MailboxReleased(const std::string& mailbox_name,
49 int gpu_route_id,
50 int gpu_host_id,
51 unsigned sync_point);
40 void UpdateUVRect(); 52 void UpdateUVRect();
41 53
42 int host_routing_id_; 54 int host_routing_id_;
43 bool last_mailbox_valid_; 55 bool last_mailbox_valid_;
56 bool ack_pending_;
44 57
45 gfx::Size buffer_size_; 58 gfx::Size buffer_size_;
46 gfx::Size container_size_; 59 gfx::Size container_size_;
47 60
48 scoped_refptr<cc::TextureLayer> texture_layer_; 61 scoped_refptr<cc::TextureLayer> texture_layer_;
49 scoped_ptr<WebKit::WebLayer> web_layer_; 62 scoped_ptr<WebKit::WebLayer> web_layer_;
50 WebKit::WebPluginContainer* container_; 63 WebKit::WebPluginContainer* container_;
64
65 scoped_refptr<BrowserPluginManager> browser_plugin_manager_;
51 }; 66 };
52 67
53 } // namespace content 68 } // namespace content
54 69
55 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_COMPOSITING_HELPER_H_ 70 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_COMPOSITING_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698