diff options
author | Kristian Monsen <kristianm@google.com> | 2011-05-11 20:53:37 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2011-05-16 13:54:48 +0100 |
commit | 21d179b334e59e9a3bfcaed4c4430bef1bc5759d (patch) | |
tree | 64e2bb6da27af6a5c93ca34f6051584aafbfcb9e /webkit/glue/plugins/quickdraw_drawing_manager_mac.h | |
parent | 0c63f00edd6ed0482fd5cbcea937ca088baf7858 (diff) | |
download | external_chromium-21d179b334e59e9a3bfcaed4c4430bef1bc5759d.zip external_chromium-21d179b334e59e9a3bfcaed4c4430bef1bc5759d.tar.gz external_chromium-21d179b334e59e9a3bfcaed4c4430bef1bc5759d.tar.bz2 |
Merge Chromium at 10.0.621.0: Initial merge by git.
Change-Id: I070cc91c608dfa4a968a5a54c173260765ac8097
Diffstat (limited to 'webkit/glue/plugins/quickdraw_drawing_manager_mac.h')
-rw-r--r-- | webkit/glue/plugins/quickdraw_drawing_manager_mac.h | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/webkit/glue/plugins/quickdraw_drawing_manager_mac.h b/webkit/glue/plugins/quickdraw_drawing_manager_mac.h deleted file mode 100644 index 8163f92..0000000 --- a/webkit/glue/plugins/quickdraw_drawing_manager_mac.h +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_GLUE_QUICKDRAW_DRAWING_MANAGER_MAC_H_ -#define WEBKIT_GLUE_QUICKDRAW_DRAWING_MANAGER_MAC_H_ - -#ifndef NP_NO_QUICKDRAW - -#import <Carbon/Carbon.h> - -#include "gfx/rect.h" - -// Plugin helper class encapsulating the details of capturing what a QuickDraw -// drawing model plugin draws, then drawing it into a CGContext. -class QuickDrawDrawingManager { - public: - QuickDrawDrawingManager(); - ~QuickDrawDrawingManager(); - - // Sets the mode used for plugin drawing. If enabled is true the plugin draws - // into a GWorld that's not connected to a window, otherwise the plugin draws - // into our the plugin's dummy window (which is slower, since the call we use - // to scrape the window contents is much more expensive than copying between - // GWorlds). - void SetFastPathEnabled(bool enabled); - - // Returns true if the fast path is currently enabled. - bool IsFastPathEnabled(); - - // Sets the context that the plugin bits should be copied into when - // UpdateContext is called. This object does not retain |context|, so the - // caller must call SetTargetContext again if the context changes. - // If the fast path is currently enabled, this call will cause the port to - // change. - void SetTargetContext(CGContextRef context, const gfx::Size& plugin_size); - - // Sets the window that is used by the plugin. This object does not own the - // window, so the caler must call SetPluginWindow again if the window changes. - void SetPluginWindow(WindowRef window); - - // Updates the target context with the current plugin bits. - void UpdateContext(); - - // Returns the port that the plugin should draw into. This returned port is - // only valid until the next call to SetFastPathEnabled (or SetTargetContext - // while the fast path is enabled). - CGrafPtr port() { return current_port_; } - - // Makes the QuickDraw port current; should be called before calls where the - // plugin might draw. - void MakePortCurrent(); - - private: - // Updates the GWorlds used by the faster path. - void UpdateGWorlds(); - - // Deletes the GWorlds used by the faster path. - void DestroyGWorlds(); - - // Scrapes the contents of the window into the given context. - // Used for the slower path. - static void ScrapeWindow(WindowRef window, CGContextRef target_context, - const gfx::Size& plugin_size); - - // Copies the source GWorld's bits into the target GWorld. - // Used for the faster path. - static void CopyGWorldBits(GWorldPtr source, GWorldPtr dest, - const gfx::Size& plugin_size); - - WindowRef plugin_window_; // Weak reference. - CGContextRef target_context_; // Weak reference. - gfx::Size plugin_size_; - bool fast_path_enabled_; - CGrafPtr current_port_; - // Variables used for the faster path: - GWorldPtr target_world_; // Created lazily; may be NULL. - GWorldPtr plugin_world_; // Created lazily; may be NULL. -}; - -#endif // !NP_NO_QUICKDRAW - -#endif // QUICKDRAW_DRAWING_MANAGER_MAC |