OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "web_content_layer_impl.h" | 5 #include "web_content_layer_impl.h" |
6 | 6 |
7 #include "SkMatrix44.h" | 7 #include "SkMatrix44.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "cc/content_layer.h" | 9 #include "cc/content_layer.h" |
10 #include "cc/picture_layer.h" | 10 #include "cc/picture_layer.h" |
11 #include "cc/switches.h" | 11 #include "cc/switches.h" |
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebContentLayerClie
nt.h" | 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebContentLayerClie
nt.h" |
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" |
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" |
15 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" |
16 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
17 | 17 |
18 using namespace cc; | 18 using namespace cc; |
19 | 19 |
20 namespace WebKit { | 20 namespace WebKit { |
21 | 21 |
22 static bool usingPictureLayer() | 22 static bool usingPictureLayer() |
23 { | 23 { |
24 return CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kImplSidePa
inting); | 24 return CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kImplSidePa
inting); |
25 } | 25 } |
26 | 26 |
27 WebContentLayer* WebContentLayer::create(WebContentLayerClient* client) | |
28 { | |
29 return new WebContentLayerImpl(client); | |
30 } | |
31 | |
32 WebContentLayerImpl::WebContentLayerImpl(WebContentLayerClient* client) | 27 WebContentLayerImpl::WebContentLayerImpl(WebContentLayerClient* client) |
33 : m_client(client) | 28 : m_client(client) |
34 { | 29 { |
35 if (usingPictureLayer()) | 30 if (usingPictureLayer()) |
36 m_layer = make_scoped_ptr(new WebLayerImpl(PictureLayer::create(this))); | 31 m_layer = make_scoped_ptr(new WebLayerImpl(PictureLayer::create(this))); |
37 else | 32 else |
38 m_layer = make_scoped_ptr(new WebLayerImpl(ContentLayer::create(this))); | 33 m_layer = make_scoped_ptr(new WebLayerImpl(ContentLayer::create(this))); |
39 m_layer->layer()->setIsDrawable(true); | 34 m_layer->layer()->setIsDrawable(true); |
40 } | 35 } |
41 | 36 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 m_client->paintContents(canvas, | 86 m_client->paintContents(canvas, |
92 clip, | 87 clip, |
93 #if WEBCONTENTLAYERCLIENT_HAS_CANPAINTLCDTEXT | 88 #if WEBCONTENTLAYERCLIENT_HAS_CANPAINTLCDTEXT |
94 m_layer->layer()->useLCDText(), | 89 m_layer->layer()->useLCDText(), |
95 #endif // WEBCONTENTLAYERCLIENT_HAS_CANPAINTLCDTEXT | 90 #endif // WEBCONTENTLAYERCLIENT_HAS_CANPAINTLCDTEXT |
96 webOpaque); | 91 webOpaque); |
97 opaque = webOpaque; | 92 opaque = webOpaque; |
98 } | 93 } |
99 | 94 |
100 } // namespace WebKit | 95 } // namespace WebKit |
OLD | NEW |