| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 24 matching lines...) Expand all Loading... |
| 35 #include "core/dom/Element.h" | 35 #include "core/dom/Element.h" |
| 36 #include "core/editing/FrameSelection.h" | 36 #include "core/editing/FrameSelection.h" |
| 37 #include "core/frame/EventHandlerRegistry.h" | 37 #include "core/frame/EventHandlerRegistry.h" |
| 38 #include "core/frame/FrameView.h" | 38 #include "core/frame/FrameView.h" |
| 39 #include "core/frame/LocalFrame.h" | 39 #include "core/frame/LocalFrame.h" |
| 40 #include "core/frame/Settings.h" | 40 #include "core/frame/Settings.h" |
| 41 #include "core/html/HTMLDocument.h" | 41 #include "core/html/HTMLDocument.h" |
| 42 #include "core/html/HTMLIFrameElement.h" | 42 #include "core/html/HTMLIFrameElement.h" |
| 43 #include "core/html/HTMLInputElement.h" | 43 #include "core/html/HTMLInputElement.h" |
| 44 #include "core/html/HTMLTextAreaElement.h" | 44 #include "core/html/HTMLTextAreaElement.h" |
| 45 #include "core/layout/Layer.h" |
| 45 #include "core/loader/FrameLoadRequest.h" | 46 #include "core/loader/FrameLoadRequest.h" |
| 46 #include "core/page/Chrome.h" | 47 #include "core/page/Chrome.h" |
| 47 #include "core/page/Page.h" | 48 #include "core/page/Page.h" |
| 48 #include "core/paint/LayerPainter.h" | 49 #include "core/paint/LayerPainter.h" |
| 49 #include "core/rendering/RenderLayer.h" | |
| 50 #include "core/rendering/RenderView.h" | 50 #include "core/rendering/RenderView.h" |
| 51 #include "core/testing/URLTestHelpers.h" | 51 #include "core/testing/URLTestHelpers.h" |
| 52 #include "platform/KeyboardCodes.h" | 52 #include "platform/KeyboardCodes.h" |
| 53 #include "platform/geometry/IntSize.h" | 53 #include "platform/geometry/IntSize.h" |
| 54 #include "platform/graphics/Color.h" | 54 #include "platform/graphics/Color.h" |
| 55 #include "public/platform/Platform.h" | 55 #include "public/platform/Platform.h" |
| 56 #include "public/platform/WebClipboard.h" | 56 #include "public/platform/WebClipboard.h" |
| 57 #include "public/platform/WebDisplayMode.h" | 57 #include "public/platform/WebDisplayMode.h" |
| 58 #include "public/platform/WebDragData.h" | 58 #include "public/platform/WebDragData.h" |
| 59 #include "public/platform/WebSize.h" | 59 #include "public/platform/WebSize.h" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 // Set canvas background to red with alpha. | 345 // Set canvas background to red with alpha. |
| 346 SkBitmap bitmap; | 346 SkBitmap bitmap; |
| 347 bitmap.allocN32Pixels(kWidth, kHeight); | 347 bitmap.allocN32Pixels(kWidth, kHeight); |
| 348 SkCanvas canvas(bitmap); | 348 SkCanvas canvas(bitmap); |
| 349 canvas.clear(kAlphaRed); | 349 canvas.clear(kAlphaRed); |
| 350 | 350 |
| 351 GraphicsContext context(&canvas, nullptr); | 351 GraphicsContext context(&canvas, nullptr); |
| 352 | 352 |
| 353 // Paint the root of the main frame in the way that CompositedLayerMapping w
ould. | 353 // Paint the root of the main frame in the way that CompositedLayerMapping w
ould. |
| 354 FrameView* view = m_webViewHelper.webViewImpl()->mainFrameImpl()->frameView(
); | 354 FrameView* view = m_webViewHelper.webViewImpl()->mainFrameImpl()->frameView(
); |
| 355 RenderLayer* rootLayer = view->renderView()->layer(); | 355 Layer* rootLayer = view->renderView()->layer(); |
| 356 IntRect paintRect(0, 0, kWidth, kHeight); | 356 IntRect paintRect(0, 0, kWidth, kHeight); |
| 357 LayerPaintingInfo paintingInfo(rootLayer, paintRect, PaintBehaviorNormal, La
youtSize()); | 357 LayerPaintingInfo paintingInfo(rootLayer, paintRect, PaintBehaviorNormal, La
youtSize()); |
| 358 LayerPainter(*rootLayer).paintLayerContents(&context, paintingInfo, PaintLay
erPaintingCompositingAllPhases); | 358 LayerPainter(*rootLayer).paintLayerContents(&context, paintingInfo, PaintLay
erPaintingCompositingAllPhases); |
| 359 | 359 |
| 360 // The result should be a blend of red and green. | 360 // The result should be a blend of red and green. |
| 361 SkColor color = bitmap.getColor(kWidth / 2, kHeight / 2); | 361 SkColor color = bitmap.getColor(kWidth / 2, kHeight / 2); |
| 362 EXPECT_TRUE(redChannel(color)); | 362 EXPECT_TRUE(redChannel(color)); |
| 363 EXPECT_TRUE(greenChannel(color)); | 363 EXPECT_TRUE(greenChannel(color)); |
| 364 } | 364 } |
| 365 | 365 |
| (...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2332 // Test without any preventDefault. | 2332 // Test without any preventDefault. |
| 2333 client.reset(); | 2333 client.reset(); |
| 2334 frame->executeScript(WebScriptSource("setTest('none');")); | 2334 frame->executeScript(WebScriptSource("setTest('none');")); |
| 2335 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr
omUTF8("target"))); | 2335 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr
omUTF8("target"))); |
| 2336 EXPECT_TRUE(client.getWasCalled()); | 2336 EXPECT_TRUE(client.getWasCalled()); |
| 2337 | 2337 |
| 2338 m_webViewHelper.reset(); // Remove dependency on locally scoped client. | 2338 m_webViewHelper.reset(); // Remove dependency on locally scoped client. |
| 2339 } | 2339 } |
| 2340 | 2340 |
| 2341 } // namespace | 2341 } // namespace |
| OLD | NEW |