Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / platform / scroll / ScrollbarThemeMacNonOverlayAPI.mm
index 41ff3be..3555ae4 100644 (file)
@@ -87,6 +87,8 @@ static blink::WebThemeEngine::State scrollbarStateToThemeState(ScrollbarThemeCli
 //     - Skia specific changes
 bool ScrollbarThemeMacNonOverlayAPI::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* context, const IntRect& damageRect)
 {
+    if (context->paintingDisabled())
+        return true;
     // Get the tickmarks for the frameview.
     Vector<IntRect> tickmarks;
     scrollbar->getTickmarks(tickmarks);
@@ -168,8 +170,11 @@ bool ScrollbarThemeMacNonOverlayAPI::paint(ScrollbarThemeClient* scrollbar, Grap
             scrollbarInfo);
     }
 
-    if (!canDrawDirectly)
-        context->drawImageBuffer(imageBuffer.get(), scrollbar->frameRect().location());
+    if (!canDrawDirectly) {
+        ASSERT(imageBuffer);
+        context->drawImageBuffer(imageBuffer.get(),
+            FloatRect(scrollbar->frameRect().location(), imageBuffer->size()));
+    }
 
     return true;
 }