OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "core/html/HTMLSelectElement.h" | 47 #include "core/html/HTMLSelectElement.h" |
48 #include "core/html/ImageData.h" | 48 #include "core/html/ImageData.h" |
49 #include "core/html/canvas/CanvasAsyncBlobCreator.h" | 49 #include "core/html/canvas/CanvasAsyncBlobCreator.h" |
50 #include "core/html/canvas/CanvasContextCreationAttributes.h" | 50 #include "core/html/canvas/CanvasContextCreationAttributes.h" |
51 #include "core/html/canvas/CanvasFontCache.h" | 51 #include "core/html/canvas/CanvasFontCache.h" |
52 #include "core/html/canvas/CanvasRenderingContext.h" | 52 #include "core/html/canvas/CanvasRenderingContext.h" |
53 #include "core/html/canvas/CanvasRenderingContextFactory.h" | 53 #include "core/html/canvas/CanvasRenderingContextFactory.h" |
54 #include "core/imagebitmap/ImageBitmapOptions.h" | 54 #include "core/imagebitmap/ImageBitmapOptions.h" |
55 #include "core/layout/HitTestCanvasResult.h" | 55 #include "core/layout/HitTestCanvasResult.h" |
56 #include "core/layout/LayoutHTMLCanvas.h" | 56 #include "core/layout/LayoutHTMLCanvas.h" |
| 57 #include "core/layout/api/LayoutViewItem.h" |
| 58 #include "core/layout/compositing/PaintLayerCompositor.h" |
57 #include "core/paint/PaintLayer.h" | 59 #include "core/paint/PaintLayer.h" |
58 #include "core/paint/PaintTiming.h" | 60 #include "core/paint/PaintTiming.h" |
59 #include "platform/Histogram.h" | 61 #include "platform/Histogram.h" |
60 #include "platform/RuntimeEnabledFeatures.h" | 62 #include "platform/RuntimeEnabledFeatures.h" |
61 #include "platform/graphics/Canvas2DImageBufferSurface.h" | 63 #include "platform/graphics/Canvas2DImageBufferSurface.h" |
62 #include "platform/graphics/CanvasMetrics.h" | 64 #include "platform/graphics/CanvasMetrics.h" |
63 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" | 65 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" |
64 #include "platform/graphics/ImageBuffer.h" | 66 #include "platform/graphics/ImageBuffer.h" |
65 #include "platform/graphics/RecordingImageBufferSurface.h" | 67 #include "platform/graphics/RecordingImageBufferSurface.h" |
66 #include "platform/graphics/StaticBitmapImage.h" | 68 #include "platform/graphics/StaticBitmapImage.h" |
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 return String(); | 1365 return String(); |
1364 } | 1366 } |
1365 | 1367 |
1366 bool HTMLCanvasElement::createSurfaceLayer() { | 1368 bool HTMLCanvasElement::createSurfaceLayer() { |
1367 DCHECK(!m_surfaceLayerBridge); | 1369 DCHECK(!m_surfaceLayerBridge); |
1368 mojom::blink::OffscreenCanvasSurfacePtr service; | 1370 mojom::blink::OffscreenCanvasSurfacePtr service; |
1369 Platform::current()->interfaceProvider()->getInterface( | 1371 Platform::current()->interfaceProvider()->getInterface( |
1370 mojo::GetProxy(&service)); | 1372 mojo::GetProxy(&service)); |
1371 m_surfaceLayerBridge = | 1373 m_surfaceLayerBridge = |
1372 wrapUnique(new CanvasSurfaceLayerBridge(std::move(service))); | 1374 wrapUnique(new CanvasSurfaceLayerBridge(std::move(service))); |
1373 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), | 1375 bool result = |
1374 this->height()); | 1376 m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height()); |
| 1377 // After creating a new WebLayer, we want to force compositor commit |
| 1378 // to repaint. |
| 1379 document().layoutViewItem().compositor()->setNeedsCompositingUpdate( |
| 1380 CompositingUpdateRebuildTree); |
| 1381 |
| 1382 return result; |
1375 } | 1383 } |
1376 | 1384 |
1377 } // namespace blink | 1385 } // namespace blink |
OLD | NEW |