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

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.h

Issue 11053003: Migrate Graphics2D to new design. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
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 WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_
6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ 6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 namespace webkit { 82 namespace webkit {
83 namespace ppapi { 83 namespace ppapi {
84 84
85 class ContentDecryptorDelegate; 85 class ContentDecryptorDelegate;
86 class FullscreenContainer; 86 class FullscreenContainer;
87 class MessageChannel; 87 class MessageChannel;
88 class PluginDelegate; 88 class PluginDelegate;
89 class PluginModule; 89 class PluginModule;
90 class PluginObject; 90 class PluginObject;
91 class PPB_Graphics2D_Impl;
92 class PPB_Graphics3D_Impl; 91 class PPB_Graphics3D_Impl;
93 class PPB_ImageData_Impl; 92 class PPB_ImageData_Impl;
94 class PPB_URLLoader_Impl; 93 class PPB_URLLoader_Impl;
95 94
96 // Represents one time a plugin appears on one web page. 95 // Represents one time a plugin appears on one web page.
97 // 96 //
98 // Note: to get from a PP_Instance to a PluginInstance*, use the 97 // Note: to get from a PP_Instance to a PluginInstance*, use the
99 // ResourceTracker. 98 // ResourceTracker.
100 class WEBKIT_PLUGINS_EXPORT PluginInstance : 99 class WEBKIT_PLUGINS_EXPORT PluginInstance :
101 public base::RefCounted<PluginInstance>, 100 public base::RefCounted<PluginInstance>,
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 void ReportGeometry(); 509 void ReportGeometry();
511 510
512 // Queries the plugin for supported print formats and sets |format| to the 511 // Queries the plugin for supported print formats and sets |format| to the
513 // best format to use. Returns false if the plugin does not support any 512 // best format to use. Returns false if the plugin does not support any
514 // print format that we can handle (we can handle only PDF). 513 // print format that we can handle (we can handle only PDF).
515 bool GetPreferredPrintOutputFormat(PP_PrintOutputFormat_Dev* format); 514 bool GetPreferredPrintOutputFormat(PP_PrintOutputFormat_Dev* format);
516 bool PrintPDFOutput(PP_Resource print_output, WebKit::WebCanvas* canvas); 515 bool PrintPDFOutput(PP_Resource print_output, WebKit::WebCanvas* canvas);
517 516
518 // Get the bound graphics context as a concrete 2D graphics context or returns 517 // Get the bound graphics context as a concrete 2D graphics context or returns
519 // null if the context is not 2D. 518 // null if the context is not 2D.
520 PPB_Graphics2D_Impl* GetBoundGraphics2D() const; 519 PluginDelegate::PlatformGraphics2D* GetBoundGraphics2D() const;
521 520
522 // Get the bound 3D graphics context. 521 // Get the bound 3D graphics context.
523 // Returns NULL if bound graphics is not a 3D context. 522 // Returns NULL if bound graphics is not a 3D context.
524 PPB_Graphics3D_Impl* GetBoundGraphics3D() const; 523 PPB_Graphics3D_Impl* GetBoundGraphics3D() const;
525 524
526 // Sets the id of the texture that the plugin draws to. The id is in the 525 // Sets the id of the texture that the plugin draws to. The id is in the
527 // compositor space so it can use it to composite with rest of the page. 526 // compositor space so it can use it to composite with rest of the page.
528 // A value of zero indicates the plugin is not backed by a texture. 527 // A value of zero indicates the plugin is not backed by a texture.
529 // is_opaque is true if the plugin contents are always opaque. 528 // is_opaque is true if the plugin contents are always opaque.
530 void setBackingTextureId(unsigned int id, bool is_opaque); 529 void setBackingTextureId(unsigned int id, bool is_opaque);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 // same as the default values. 589 // same as the default values.
591 bool sent_initial_did_change_view_; 590 bool sent_initial_did_change_view_;
592 591
593 // We use a weak ptr factory for scheduling DidChangeView events so that we 592 // We use a weak ptr factory for scheduling DidChangeView events so that we
594 // can tell whether updates are pending and consolidate them. When there's 593 // can tell whether updates are pending and consolidate them. When there's
595 // already a weak ptr pending (HasWeakPtrs is true), code should update the 594 // already a weak ptr pending (HasWeakPtrs is true), code should update the
596 // view_data_ but not send updates. This also allows us to cancel scheduled 595 // view_data_ but not send updates. This also allows us to cancel scheduled
597 // view change events. 596 // view change events.
598 base::WeakPtrFactory<PluginInstance> view_change_weak_ptr_factory_; 597 base::WeakPtrFactory<PluginInstance> view_change_weak_ptr_factory_;
599 598
600 // The current device context for painting in 2D or 3D. 599 // The current device context for painting in 2D and 3D.
601 scoped_refptr< ::ppapi::Resource> bound_graphics_; 600 scoped_refptr< ::ppapi::Resource> bound_graphics_3d_;
601 PluginDelegate::PlatformGraphics2D* bound_graphics_2d_platform_;
602 602
603 // We track two types of focus, one from WebKit, which is the focus among 603 // We track two types of focus, one from WebKit, which is the focus among
604 // all elements of the page, one one from the browser, which is whether the 604 // all elements of the page, one one from the browser, which is whether the
605 // tab/window has focus. We tell the plugin it has focus only when both of 605 // tab/window has focus. We tell the plugin it has focus only when both of
606 // these values are set to true. 606 // these values are set to true.
607 bool has_webkit_focus_; 607 bool has_webkit_focus_;
608 bool has_content_area_focus_; 608 bool has_content_area_focus_;
609 609
610 // The id of the current find operation, or -1 if none is in process. 610 // The id of the current find operation, or -1 if none is in process.
611 int find_identifier_; 611 int find_identifier_;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 // calls and handles PPB_ContentDecryptor_Private calls. 752 // calls and handles PPB_ContentDecryptor_Private calls.
753 scoped_ptr<ContentDecryptorDelegate> content_decryptor_delegate_; 753 scoped_ptr<ContentDecryptorDelegate> content_decryptor_delegate_;
754 754
755 DISALLOW_COPY_AND_ASSIGN(PluginInstance); 755 DISALLOW_COPY_AND_ASSIGN(PluginInstance);
756 }; 756 };
757 757
758 } // namespace ppapi 758 } // namespace ppapi
759 } // namespace webkit 759 } // namespace webkit
760 760
761 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ 761 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698