summaryrefslogtreecommitdiffstats
path: root/base/gfx
diff options
context:
space:
mode:
authorojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-09 21:58:05 +0000
committerojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-09 21:58:05 +0000
commit8a2820a90f85f91c500a9d382f8e8ba870fb621c (patch)
tree8d8bd23228cd1e6455e64b0de46e961947459382 /base/gfx
parent283f76091ad757bdc17c6d9090209eade4211075 (diff)
downloadchromium_src-8a2820a90f85f91c500a9d382f8e8ba870fb621c.zip
chromium_src-8a2820a90f85f91c500a9d382f8e8ba870fb621c.tar.gz
chromium_src-8a2820a90f85f91c500a9d382f8e8ba870fb621c.tar.bz2
Patch by Thatcher Ulrich <tulrich@google.com>.
Implement "iframe shim" behavior for windowed plugins. In FF and IE on windows, iframes are implemented as native HWNDs. This has the side effect that iframes display on top of windowed plugins. This side effect has long been known as a workaround for allowing HTML elements to appear above plugin content. BUG=1788 Review URL: http://codereview.chromium.org/7032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3137 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/gfx')
-rw-r--r--base/gfx/bitmap_platform_device_win.cc2
-rw-r--r--base/gfx/gdi_util.cc (renamed from base/gfx/bitmap_header.cc)18
-rw-r--r--base/gfx/gdi_util.h (renamed from base/gfx/bitmap_header.h)12
-rw-r--r--base/gfx/native_theme.cc2
-rw-r--r--base/gfx/vector_canvas_unittest.cc2
-rw-r--r--base/gfx/vector_device.cc2
6 files changed, 29 insertions, 9 deletions
diff --git a/base/gfx/bitmap_platform_device_win.cc b/base/gfx/bitmap_platform_device_win.cc
index 1209db1..2031027 100644
--- a/base/gfx/bitmap_platform_device_win.cc
+++ b/base/gfx/bitmap_platform_device_win.cc
@@ -4,7 +4,7 @@
#include "base/gfx/bitmap_platform_device_win.h"
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/logging.h"
#include "base/process_util.h"
#include "SkMatrix.h"
diff --git a/base/gfx/bitmap_header.cc b/base/gfx/gdi_util.cc
index acaf0c0..48df853 100644
--- a/base/gfx/bitmap_header.cc
+++ b/base/gfx/gdi_util.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
namespace gfx {
@@ -60,5 +60,21 @@ void CreateMonochromeBitmapHeader(int width,
hdr->biClrImportant = 0;
}
+void SubtractRectanglesFromRegion(HRGN hrgn,
+ const std::vector<gfx::Rect>& cutouts) {
+ if (cutouts.size()) {
+ HRGN cutout = ::CreateRectRgn(0, 0, 0, 0);
+ for (size_t i = 0; i < cutouts.size(); i++) {
+ ::SetRectRgn(cutout,
+ cutouts[i].x(),
+ cutouts[i].y(),
+ cutouts[i].right(),
+ cutouts[i].bottom());
+ ::CombineRgn(hrgn, hrgn, cutout, RGN_DIFF);
+ }
+ ::DeleteObject(cutout);
+ }
+}
+
} // namespace gfx
diff --git a/base/gfx/bitmap_header.h b/base/gfx/gdi_util.h
index 0c8066b..cc15e92 100644
--- a/base/gfx/bitmap_header.h
+++ b/base/gfx/gdi_util.h
@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_GFX_BITMAP_HEADER_H__
-#define BASE_GFX_BITMAP_HEADER_H__
+#ifndef BASE_GFX_GDI_UTIL_H__
+#define BASE_GFX_GDI_UTIL_H__
+#include <vector>
#include <windows.h>
+#include "base/gfx/rect.h"
namespace gfx {
@@ -25,8 +27,10 @@ void CreateBitmapV4Header(int width, int height, BITMAPV4HEADER* hdr);
// Creates a monochrome bitmap header.
void CreateMonochromeBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr);
+// Modify the given hrgn by subtracting the given rectangles.
+void SubtractRectanglesFromRegion(HRGN hrgn,
+ const std::vector<gfx::Rect>& cutouts);
} // namespace gfx
-#endif // BASE_GFX_BITMAP_HEADER_H__
-
+#endif // BASE_GFX_GDI_UTIL_H__
diff --git a/base/gfx/native_theme.cc b/base/gfx/native_theme.cc
index ea55502..b8aa30c 100644
--- a/base/gfx/native_theme.cc
+++ b/base/gfx/native_theme.cc
@@ -9,7 +9,7 @@
#include <vsstyle.h>
#include <vssym32.h>
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/gfx/platform_canvas_win.h"
#include "base/gfx/skia_utils.h"
#include "base/gfx/rect.h"
diff --git a/base/gfx/vector_canvas_unittest.cc b/base/gfx/vector_canvas_unittest.cc
index 65d3d5f..60a79ba 100644
--- a/base/gfx/vector_canvas_unittest.cc
+++ b/base/gfx/vector_canvas_unittest.cc
@@ -8,7 +8,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/gfx/png_decoder.h"
#include "base/gfx/png_encoder.h"
#include "base/gfx/size.h"
diff --git a/base/gfx/vector_device.cc b/base/gfx/vector_device.cc
index 8778299..7230e2b 100644
--- a/base/gfx/vector_device.cc
+++ b/base/gfx/vector_device.cc
@@ -4,7 +4,7 @@
#include "base/gfx/vector_device.h"
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/gfx/skia_utils.h"
#include "base/logging.h"
#include "base/scoped_handle.h"