Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "PageWidgetDelegate.h" | 32 #include "PageWidgetDelegate.h" |
| 33 | 33 |
| 34 #include "PageOverlayList.h" | 34 #include "PageOverlayList.h" |
| 35 #include "WebInputEvent.h" | 35 #include "WebInputEvent.h" |
| 36 #include "WebInputEventConversion.h" | 36 #include "WebInputEventConversion.h" |
| 37 #include "core/page/EventHandler.h" | 37 #include "core/page/EventHandler.h" |
| 38 #include "core/page/Frame.h" | 38 #include "core/page/Frame.h" |
| 39 #include "core/page/FrameView.h" | 39 #include "core/page/FrameView.h" |
| 40 #include "core/platform/graphics/GraphicsContext.h" | 40 #include "core/platform/graphics/GraphicsContext.h" |
| 41 #include "core/rendering/RenderLayerCompositor.h" | |
| 42 #include "core/rendering/RenderView.h" | |
| 41 #include "wtf/CurrentTime.h" | 43 #include "wtf/CurrentTime.h" |
| 42 | 44 |
| 43 using namespace WebCore; | 45 using namespace WebCore; |
| 44 | 46 |
| 45 namespace WebKit { | 47 namespace WebKit { |
| 46 | 48 |
| 47 static inline FrameView* mainFrameView(Page* page) | 49 static inline FrameView* mainFrameView(Page* page) |
| 48 { | 50 { |
| 49 if (!page) | 51 if (!page) |
| 50 return 0; | 52 return 0; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 71 // they need to be told that we are updating the screen. The problem is that | 73 // they need to be told that we are updating the screen. The problem is that |
| 72 // the native widgets need to recalculate their clip region and not overlap | 74 // the native widgets need to recalculate their clip region and not overlap |
| 73 // any of our non-native widgets. To force the resizing, call | 75 // any of our non-native widgets. To force the resizing, call |
| 74 // setFrameRect(). This will be a quick operation for most frames, but the | 76 // setFrameRect(). This will be a quick operation for most frames, but the |
| 75 // NativeWindowWidgets will update a proper clipping region. | 77 // NativeWindowWidgets will update a proper clipping region. |
| 76 view->setFrameRect(view->frameRect()); | 78 view->setFrameRect(view->frameRect()); |
| 77 | 79 |
| 78 // setFrameRect may have the side-effect of causing existing page layout to | 80 // setFrameRect may have the side-effect of causing existing page layout to |
| 79 // be invalidated, so layout needs to be called last. | 81 // be invalidated, so layout needs to be called last. |
| 80 view->updateLayoutAndStyleIfNeededRecursive(); | 82 view->updateLayoutAndStyleIfNeededRecursive(); |
| 83 | |
| 84 // FIXME: is this a reasonable place for this? | |
|
jamesr
2013/10/08 17:51:16
this is reasonable since we don't have a better en
| |
| 85 // Finally do all the deferred work for updateCompositingLayers() here. | |
| 86 view->renderView()->compositor()->updateCompositingLayers(CompositingUpdateO nBeginDrawingFrame); | |
| 81 } | 87 } |
| 82 | 88 |
| 83 void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background) | 89 void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background) |
| 84 { | 90 { |
| 85 if (rect.isEmpty()) | 91 if (rect.isEmpty()) |
| 86 return; | 92 return; |
| 87 GraphicsContext gc(canvas); | 93 GraphicsContext gc(canvas); |
| 88 gc.setCertainlyOpaque(background == Opaque); | 94 gc.setCertainlyOpaque(background == Opaque); |
| 89 gc.applyDeviceScaleFactor(page->deviceScaleFactor()); | 95 gc.applyDeviceScaleFactor(page->deviceScaleFactor()); |
| 90 gc.setUseHighResMarkers(page->deviceScaleFactor() > 1.5f); | 96 gc.setUseHighResMarkers(page->deviceScaleFactor() > 1.5f); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 209 { | 215 { |
| 210 return mainFrame.eventHandler()->handleWheelEvent(PlatformWheelEventBuilder( mainFrame.view(), event)); | 216 return mainFrame.eventHandler()->handleWheelEvent(PlatformWheelEventBuilder( mainFrame.view(), event)); |
| 211 } | 217 } |
| 212 | 218 |
| 213 bool PageWidgetEventHandler::handleTouchEvent(Frame& mainFrame, const WebTouchEv ent& event) | 219 bool PageWidgetEventHandler::handleTouchEvent(Frame& mainFrame, const WebTouchEv ent& event) |
| 214 { | 220 { |
| 215 return mainFrame.eventHandler()->handleTouchEvent(PlatformTouchEventBuilder( mainFrame.view(), event)); | 221 return mainFrame.eventHandler()->handleTouchEvent(PlatformTouchEventBuilder( mainFrame.view(), event)); |
| 216 } | 222 } |
| 217 | 223 |
| 218 } | 224 } |
| OLD | NEW |