Always set the current NSGraphicsContext before calling drawWithFrame
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Jul 2010 04:51:39 +0000 (04:51 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Jul 2010 04:51:39 +0000 (04:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=42542

Reviewed by Dan Bernstein.

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintMeter):
(WebCore::RenderThemeMac::paintSearchField):
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::paintSearchFieldResultsDecoration):
(WebCore::RenderThemeMac::paintSearchFieldResultsButton):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63642 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/rendering/RenderThemeMac.mm

index d36d32a630f013a27c3d23476483e35c47827d20..319bf0ca57ec6947d8d19605f8eed8fd2cfeb5ce 100644 (file)
@@ -1,3 +1,17 @@
+2010-07-18  Anders carlsson  <andersca@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Always set the current NSGraphicsContext before calling drawWithFrame
+        https://bugs.webkit.org/show_bug.cgi?id=42542
+
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintMeter):
+        (WebCore::RenderThemeMac::paintSearchField):
+        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
+        (WebCore::RenderThemeMac::paintSearchFieldResultsDecoration):
+        (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
+
 2010-07-18  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Sam Weinig.
index bbf6906fb703cec7049663317761b64a8f9530de..575940f5f76f85cc71f1ff054b527052f005870a 100644 (file)
@@ -826,6 +826,8 @@ bool RenderThemeMac::paintMeter(RenderObject* renderObject, const PaintInfo& pai
     if (!renderObject->isMeter())
         return true;
 
+    LocalCurrentGraphicsContext localContext(paintInfo.context);
+
     // Becaue NSLevelIndicatorCell doesn't support vertical gauge, we use a portable version 
     if (rect.width() < rect.height())
         return RenderTheme::paintMeter(renderObject, paintInfo, rect);
@@ -1379,8 +1381,8 @@ bool RenderThemeMac::paintSliderThumb(RenderObject* o, const PaintInfo& paintInf
 
 bool RenderThemeMac::paintSearchField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
 {
-    NSSearchFieldCell* search = this->search();
     LocalCurrentGraphicsContext localContext(paintInfo.context);
+    NSSearchFieldCell* search = this->search();
 
     setSearchCellState(o, r);
 
@@ -1480,6 +1482,7 @@ bool RenderThemeMac::paintSearchFieldCancelButton(RenderObject* o, const PaintIn
     if (!input->renderer()->isBox())
         return false;
 
+    LocalCurrentGraphicsContext localContext(paintInfo.context);
     setSearchCellState(input->renderer(), r);
 
     NSSearchFieldCell* search = this->search();
@@ -1568,6 +1571,7 @@ bool RenderThemeMac::paintSearchFieldResultsDecoration(RenderObject* o, const Pa
     if (!input->renderer()->isBox())
         return false;
 
+    LocalCurrentGraphicsContext localContext(paintInfo.context);
     setSearchCellState(input->renderer(), r);
 
     NSSearchFieldCell* search = this->search();
@@ -1600,6 +1604,7 @@ bool RenderThemeMac::paintSearchFieldResultsButton(RenderObject* o, const PaintI
     if (!input->renderer()->isBox())
         return false;
 
+    LocalCurrentGraphicsContext localContext(paintInfo.context);
     setSearchCellState(input->renderer(), r);
 
     NSSearchFieldCell* search = this->search();