| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "config.h" | |
| 6 #include "WebContentLayerImpl.h" | |
| 7 | |
| 8 #include "SkMatrix44.h" | |
| 9 #include "cc/content_layer.h" | |
| 10 #include "cc/stubs/float_rect.h" | |
| 11 #include "cc/stubs/int_rect.h" | |
| 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebContentLayerClie
nt.h" | |
| 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" | |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" | |
| 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" | |
| 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | |
| 17 #include "webcore_convert.h" | |
| 18 | |
| 19 using namespace cc; | |
| 20 | |
| 21 namespace WebKit { | |
| 22 | |
| 23 WebContentLayer* WebContentLayer::create(WebContentLayerClient* client) | |
| 24 { | |
| 25 return new WebContentLayerImpl(client); | |
| 26 } | |
| 27 | |
| 28 WebContentLayerImpl::WebContentLayerImpl(WebContentLayerClient* client) | |
| 29 : m_layer(new WebLayerImpl(ContentLayerChromium::create(this))) | |
| 30 , m_client(client) | |
| 31 { | |
| 32 m_layer->layer()->setIsDrawable(true); | |
| 33 } | |
| 34 | |
| 35 WebContentLayerImpl::~WebContentLayerImpl() | |
| 36 { | |
| 37 static_cast<ContentLayerChromium*>(m_layer->layer())->clearClient(); | |
| 38 } | |
| 39 | |
| 40 WebLayer* WebContentLayerImpl::layer() | |
| 41 { | |
| 42 return m_layer.get(); | |
| 43 } | |
| 44 | |
| 45 void WebContentLayerImpl::setDoubleSided(bool doubleSided) | |
| 46 { | |
| 47 m_layer->layer()->setDoubleSided(doubleSided); | |
| 48 } | |
| 49 | |
| 50 void WebContentLayerImpl::setBoundsContainPageScale(bool boundsContainPageScale) | |
| 51 { | |
| 52 return m_layer->layer()->setBoundsContainPageScale(boundsContainPageScale); | |
| 53 } | |
| 54 | |
| 55 bool WebContentLayerImpl::boundsContainPageScale() const | |
| 56 { | |
| 57 return m_layer->layer()->boundsContainPageScale(); | |
| 58 } | |
| 59 | |
| 60 void WebContentLayerImpl::setUseLCDText(bool enable) | |
| 61 { | |
| 62 m_layer->layer()->setUseLCDText(enable); | |
| 63 } | |
| 64 | |
| 65 void WebContentLayerImpl::setDrawCheckerboardForMissingTiles(bool enable) | |
| 66 { | |
| 67 m_layer->layer()->setDrawCheckerboardForMissingTiles(enable); | |
| 68 } | |
| 69 | |
| 70 | |
| 71 void WebContentLayerImpl::paintContents(SkCanvas* canvas, const IntRect& clip, F
loatRect& opaque) | |
| 72 { | |
| 73 if (!m_client) | |
| 74 return; | |
| 75 WebFloatRect webOpaque; | |
| 76 m_client->paintContents(canvas, convert(clip), webOpaque); | |
| 77 opaque = convert(webOpaque); | |
| 78 } | |
| 79 | |
| 80 } // namespace WebKit | |
| OLD | NEW |