summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorzhaoqin@google.com <zhaoqin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-01 18:39:35 +0000
committerzhaoqin@google.com <zhaoqin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-01 18:39:35 +0000
commite213c757f9c1b4e2ad27b0580eb76ed5bb18363c (patch)
tree0943b95184b8deeae86350ebd7e3eedef057bd90 /content
parent516dce21e267a98a9994c1a7e5085d506c846b39 (diff)
downloadchromium_src-e213c757f9c1b4e2ad27b0580eb76ed5bb18363c.zip
chromium_src-e213c757f9c1b4e2ad27b0580eb76ed5bb18363c.tar.gz
chromium_src-e213c757f9c1b4e2ad27b0580eb76ed5bb18363c.tar.bz2
fixed issue 368400 GDI USAGE ERROR from PluginTest.CreateInstanceInPaint
- restore default brush before EndPaint R=jam@chromium.org, jcivelli@chromium.org BUG=368400 TEST=manual Review URL: https://codereview.chromium.org/262683002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267595 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/test/plugin/plugin_windowed_test.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/content/test/plugin/plugin_windowed_test.cc b/content/test/plugin/plugin_windowed_test.cc
index c0d6630..546ad21 100644
--- a/content/test/plugin/plugin_windowed_test.cc
+++ b/content/test/plugin/plugin_windowed_test.cc
@@ -130,10 +130,11 @@ LRESULT CALLBACK WindowedPluginTest::WindowProc(
PAINTSTRUCT ps;
HDC hdc = BeginPaint(window, &ps);
HBRUSH brush = CreateSolidBrush(RGB(255, 0, 0));
- SelectObject(hdc, brush);
+ HGDIOBJ orig = SelectObject(hdc, brush);
RECT r;
GetClientRect(window, &r);
Rectangle(hdc, 0, 0, r.right, r.bottom);
+ SelectObject(hdc, orig); // restore
DeleteObject(brush);
EndPaint(window, &ps);
}