Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: Source/WebKit/chromium/src/WebViewBenchmarkSupportImpl.cpp

Issue 14707008: Remove WebKit::GraphicsContextBuilder, which was trivial. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Undo whitespace change Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 12 matching lines...) Expand all
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 #include "config.h" 27 #include "config.h"
28 #include "WebViewBenchmarkSupportImpl.h" 28 #include "WebViewBenchmarkSupportImpl.h"
29 29
30 #include "WebViewImpl.h" 30 #include "WebViewImpl.h"
31 #include "core/page/FrameView.h" 31 #include "core/page/FrameView.h"
32 #include "core/platform/graphics/FloatSize.h" 32 #include "core/platform/graphics/FloatSize.h"
33 #include "core/platform/graphics/GraphicsContext.h"
33 #include "core/platform/graphics/GraphicsLayer.h" 34 #include "core/platform/graphics/GraphicsLayer.h"
34 #include "core/platform/graphics/IntRect.h" 35 #include "core/platform/graphics/IntRect.h"
35 #include "core/platform/graphics/IntSize.h" 36 #include "core/platform/graphics/IntSize.h"
36 #include "painting/GraphicsContextBuilder.h"
37 37
38 #include <public/WebCanvas.h> 38 #include <public/WebCanvas.h>
39 #include <wtf/CurrentTime.h> 39 #include <wtf/CurrentTime.h>
40 #include <wtf/OwnPtr.h> 40 #include <wtf/OwnPtr.h>
41 #include <wtf/Vector.h> 41 #include <wtf/Vector.h>
42 42
43 using namespace WebCore; 43 using namespace WebCore;
44 44
45 namespace WebKit { 45 namespace WebKit {
46 46
47 void WebViewBenchmarkSupportImpl::paintLayer(PaintClient* paintClient, GraphicsL ayer& layer, const IntRect& clip) 47 void WebViewBenchmarkSupportImpl::paintLayer(PaintClient* paintClient, GraphicsL ayer& layer, const IntRect& clip)
48 { 48 {
49 WebSize canvasSize(clip.width(), clip.height()); 49 WebSize canvasSize(clip.width(), clip.height());
50 WebCanvas* canvas = paintClient->willPaint(canvasSize); 50 WebCanvas* canvas = paintClient->willPaint(canvasSize);
51 GraphicsContextBuilder builder(canvas); 51 GraphicsContext context(canvas);
52 52
53 layer.paintGraphicsLayerContents(builder.context(), clip); 53 layer.paintGraphicsLayerContents(context, clip);
54 paintClient->didPaint(canvas); 54 paintClient->didPaint(canvas);
55 } 55 }
56 56
57 void WebViewBenchmarkSupportImpl::acceleratedPaintUnclipped(PaintClient* paintCl ient, GraphicsLayer& layer) 57 void WebViewBenchmarkSupportImpl::acceleratedPaintUnclipped(PaintClient* paintCl ient, GraphicsLayer& layer)
58 { 58 {
59 FloatSize layerSize = layer.size(); 59 FloatSize layerSize = layer.size();
60 IntRect clip(0, 0, layerSize.width(), layerSize.height()); 60 IntRect clip(0, 0, layerSize.width(), layerSize.height());
61 61
62 if (layer.drawsContent()) 62 if (layer.drawsContent())
63 paintLayer(paintClient, layer, clip); 63 paintLayer(paintClient, layer, clip);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (!m_webViewImpl->isAcceleratedCompositingActive()) 95 if (!m_webViewImpl->isAcceleratedCompositingActive())
96 return softwarePaint(paintClient, paintMode); 96 return softwarePaint(paintClient, paintMode);
97 GraphicsLayer* layer = m_webViewImpl->rootGraphicsLayer(); 97 GraphicsLayer* layer = m_webViewImpl->rootGraphicsLayer();
98 switch (paintMode) { 98 switch (paintMode) {
99 case PaintModeEverything: 99 case PaintModeEverything:
100 acceleratedPaintUnclipped(paintClient, *layer); 100 acceleratedPaintUnclipped(paintClient, *layer);
101 break; 101 break;
102 } 102 }
103 } 103 }
104 } 104 }
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/WebPopupMenuImpl.cpp ('k') | Source/WebKit/chromium/src/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698