| 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 "webkit/compositor_bindings/web_content_layer_impl.h" | 5 #include "webkit/compositor_bindings/web_content_layer_impl.h" | 
| 6 | 6 | 
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" | 
| 8 #include "cc/content_layer.h" | 8 #include "cc/content_layer.h" | 
| 9 #include "cc/picture_layer.h" | 9 #include "cc/picture_layer.h" | 
| 10 #include "cc/switches.h" | 10 #include "cc/switches.h" | 
| 11 #include "third_party/WebKit/Source/Platform/chromium/public/WebContentLayerClie
    nt.h" | 11 #include "third_party/WebKit/Source/Platform/chromium/public/WebContentLayerClie
    nt.h" | 
| 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" | 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" | 
| 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" | 
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" | 
| 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 
| 16 #include "third_party/skia/include/utils/SkMatrix44.h" | 16 #include "third_party/skia/include/utils/SkMatrix44.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::kEnableImpl
    SidePainting); | 24     return cc::switches::IsImplSidePaintingEnabled(); | 
| 25 } | 25 } | 
| 26 | 26 | 
| 27 WebContentLayerImpl::WebContentLayerImpl(WebContentLayerClient* client) | 27 WebContentLayerImpl::WebContentLayerImpl(WebContentLayerClient* client) | 
| 28     : m_client(client) | 28     : m_client(client) | 
| 29 { | 29 { | 
| 30     if (usingPictureLayer()) | 30     if (usingPictureLayer()) | 
| 31         m_layer = make_scoped_ptr(new WebLayerImpl(PictureLayer::create(this))); | 31         m_layer = make_scoped_ptr(new WebLayerImpl(PictureLayer::create(this))); | 
| 32     else | 32     else | 
| 33         m_layer = make_scoped_ptr(new WebLayerImpl(ContentLayer::create(this))); | 33         m_layer = make_scoped_ptr(new WebLayerImpl(ContentLayer::create(this))); | 
| 34     m_layer->layer()->setIsDrawable(true); | 34     m_layer->layer()->setIsDrawable(true); | 
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 82 { | 82 { | 
| 83     if (!m_client) | 83     if (!m_client) | 
| 84         return; | 84         return; | 
| 85 | 85 | 
| 86     WebFloatRect webOpaque; | 86     WebFloatRect webOpaque; | 
| 87     m_client->paintContents(canvas, clip, m_layer->layer()->canUseLCDText(), web
    Opaque); | 87     m_client->paintContents(canvas, clip, m_layer->layer()->canUseLCDText(), web
    Opaque); | 
| 88     opaque = webOpaque; | 88     opaque = webOpaque; | 
| 89 } | 89 } | 
| 90 | 90 | 
| 91 } // namespace WebKit | 91 } // namespace WebKit | 
| OLD | NEW | 
|---|