Commit 632ff8f0 authored by wjmaclean@chromium.org's avatar wjmaclean@chromium.org
Browse files

[chromium] Add WebSolidColorLayer interface to draw non-textured color layers from Aura.

https://bugs.webkit.org/show_bug.cgi?id=75732

Reviewed by James Robinson.

Source/WebCore:

Add WebSolidColorLayer to paint solid-color layers without a backing texture.

Test: unit test for CCSolidColorLayerImpl.

* WebCore.gypi:
* platform/graphics/chromium/SolidColorLayerChromium.cpp: Added.
(WebCore::SolidColorLayerChromium::createCCLayerImpl):
(WebCore::SolidColorLayerChromium::create):
(WebCore::SolidColorLayerChromium::SolidColorLayerChromium):
(WebCore::SolidColorLayerChromium::~SolidColorLayerChromium):
* platform/graphics/chromium/SolidColorLayerChromium.h: Added.
* platform/graphics/chromium/cc/CCSolidColorLayerImpl.cpp: Added.
(WebCore::CCSolidColorLayerImpl::CCSolidColorLayerImpl):
(WebCore::CCSolidColorLayerImpl::~CCSolidColorLayerImpl):
(WebCore::CCSolidColorLayerImpl::quadTransform):
(WebCore::CCSolidColorLayerImpl::appendQuads):
* platform/graphics/chromium/cc/CCSolidColorLayerImpl.h: Added.
(WebCore::CCSolidColorLayerImpl::create):
(WebCore::CCSolidColorLayerImpl::layerTypeAsString):

Source/WebKit/chromium:

* WebKit.gyp:
* WebKit.gypi:
* public/platform/WebSolidColorLayer.h: Added.
* src/WebSolidColorLayer.cpp: Added.
(WebKit::WebSolidColorLayer::create):
(WebKit::WebSolidColorLayer::WebSolidColorLayer):
(WebKit::WebSolidColorLayer::setBackgroundColor):
* src/WebSolidColorLayerImpl.cpp: Added.
(WebKit::WebSolidColorLayerImpl::create):
(WebKit::WebSolidColorLayerImpl::WebSolidColorLayerImpl):
(WebKit::WebSolidColorLayerImpl::~WebSolidColorLayerImpl):
* src/WebSolidColorLayerImpl.h: Added.
* tests/CCLayerTestCommon.cpp: Added.
(CCLayerTestCommon::completelyContains):
(CCLayerTestCommon::verifyQuadsExactlyCoverRect):
* tests/CCLayerTestCommon.h: Added.
* tests/CCSolidColorLayerImplTest.cpp: Added.
(CCLayerTestCommon::TEST):
* tests/CCTiledLayerImplTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105634 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ee769d43
2012-01-23 W. James MacLean <wjmaclean@chromium.org>
[chromium] Add WebSolidColorLayer interface to draw non-textured color layers from Aura.
https://bugs.webkit.org/show_bug.cgi?id=75732
Reviewed by James Robinson.
Add WebSolidColorLayer to paint solid-color layers without a backing texture.
Test: unit test for CCSolidColorLayerImpl.
* WebCore.gypi:
* platform/graphics/chromium/SolidColorLayerChromium.cpp: Added.
(WebCore::SolidColorLayerChromium::createCCLayerImpl):
(WebCore::SolidColorLayerChromium::create):
(WebCore::SolidColorLayerChromium::SolidColorLayerChromium):
(WebCore::SolidColorLayerChromium::~SolidColorLayerChromium):
* platform/graphics/chromium/SolidColorLayerChromium.h: Added.
* platform/graphics/chromium/cc/CCSolidColorLayerImpl.cpp: Added.
(WebCore::CCSolidColorLayerImpl::CCSolidColorLayerImpl):
(WebCore::CCSolidColorLayerImpl::~CCSolidColorLayerImpl):
(WebCore::CCSolidColorLayerImpl::quadTransform):
(WebCore::CCSolidColorLayerImpl::appendQuads):
* platform/graphics/chromium/cc/CCSolidColorLayerImpl.h: Added.
(WebCore::CCSolidColorLayerImpl::create):
(WebCore::CCSolidColorLayerImpl::layerTypeAsString):
2012-01-23 Antti Koivisto <antti@apple.com>
 
Attempt to fix Qt build.
......@@ -3573,6 +3573,8 @@
'platform/graphics/chromium/LayerTextureSubImage.h',
'platform/graphics/chromium/LayerTextureUpdater.h',
'platform/graphics/chromium/MediaPlayerPrivateChromium.h',
'platform/graphics/chromium/SolidColorLayerChromium.cpp',
'platform/graphics/chromium/SolidColorLayerChromium.h',
'platform/graphics/chromium/PlatformCanvas.cpp',
'platform/graphics/chromium/PlatformCanvas.h',
'platform/graphics/chromium/PlatformColor.h',
......@@ -3682,6 +3684,8 @@
'platform/graphics/chromium/cc/CCSingleThreadProxy.h',
'platform/graphics/chromium/cc/CCSolidColorDrawQuad.cpp',
'platform/graphics/chromium/cc/CCSolidColorDrawQuad.h',
'platform/graphics/chromium/cc/CCSolidColorLayerImpl.cpp',
'platform/graphics/chromium/cc/CCSolidColorLayerImpl.h',
'platform/graphics/chromium/cc/CCTextureUpdater.cpp',
'platform/graphics/chromium/cc/CCTextureUpdater.h',
'platform/graphics/chromium/cc/CCTileDrawQuad.cpp',
......
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#if USE(ACCELERATED_COMPOSITING)
#include "SolidColorLayerChromium.h"
#include "cc/CCSolidColorLayerImpl.h"
namespace WebCore {
PassRefPtr<CCLayerImpl> SolidColorLayerChromium::createCCLayerImpl()
{
return CCSolidColorLayerImpl::create(id());
}
PassRefPtr<SolidColorLayerChromium> SolidColorLayerChromium::create()
{
return adoptRef(new SolidColorLayerChromium());
}
SolidColorLayerChromium::SolidColorLayerChromium()
: LayerChromium()
{
}
SolidColorLayerChromium::~SolidColorLayerChromium()
{
}
} // namespace WebCore
#endif // USE(ACCELERATED_COMPOSITING)
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SolidColorLayerChromium_h
#define SolidColorLayerChromium_h
#if USE(ACCELERATED_COMPOSITING)
#include "LayerChromium.h"
namespace WebCore {
class LayerTilerChromium;
// A Layer that renders a solid color. The color is specified by using
// setBackgroundColor() on the base class.
class SolidColorLayerChromium : public LayerChromium {
public:
virtual PassRefPtr<CCLayerImpl> createCCLayerImpl();
static PassRefPtr<SolidColorLayerChromium> create();
virtual ~SolidColorLayerChromium();
protected:
SolidColorLayerChromium();
};
}
#endif // USE(ACCELERATED_COMPOSITING)
#endif
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#if USE(ACCELERATED_COMPOSITING)
#include "cc/CCSolidColorLayerImpl.h"
#include "LayerRendererChromium.h"
#include "cc/CCSolidColorDrawQuad.h"
#include <wtf/MathExtras.h>
#include <wtf/text/WTFString.h>
using namespace std;
namespace WebCore {
CCSolidColorLayerImpl::CCSolidColorLayerImpl(int id)
: CCLayerImpl(id)
, m_tileSize(256)
{
}
CCSolidColorLayerImpl::~CCSolidColorLayerImpl()
{
}
TransformationMatrix CCSolidColorLayerImpl::quadTransform() const
{
TransformationMatrix solidColorTransform = drawTransform();
solidColorTransform.translate(-bounds().width() / 2.0, -bounds().height() / 2.0);
return solidColorTransform;
}
void CCSolidColorLayerImpl::appendQuads(CCQuadList& quadList, const CCSharedQuadState* sharedQuadState)
{
// We create a series of smaller quads instead of just one large one so that the
// culler can reduce the total pixels drawn.
int width = bounds().width();
int height = bounds().height();
for (int x = 0; x < width; x += m_tileSize) {
for (int y = 0; y < height; y += m_tileSize) {
IntRect solidTileRect(x, y, min(width - x, m_tileSize), min(height - y, m_tileSize));
quadList.append(CCSolidColorDrawQuad::create(sharedQuadState, solidTileRect, backgroundColor()));
}
}
}
} // namespace WebCore
#endif // USE(ACCELERATED_COMPOSITING)
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CCSolidColorLayerImpl_h
#define CCSolidColorLayerImpl_h
#include "TransformationMatrix.h"
#include "cc/CCLayerImpl.h"
namespace WebCore {
class LayerRendererChromium;
class CCSolidColorLayerImpl : public CCLayerImpl {
public:
static PassRefPtr<CCSolidColorLayerImpl> create(int id)
{
return adoptRef(new CCSolidColorLayerImpl(id));
}
virtual ~CCSolidColorLayerImpl();
virtual TransformationMatrix quadTransform() const;
virtual void appendQuads(CCQuadList&, const CCSharedQuadState*);
protected:
explicit CCSolidColorLayerImpl(int id);
private:
virtual const char* layerTypeAsString() const { return "SolidColorLayer"; }
const int m_tileSize;
};
}
#endif // CCSolidColorLayerImpl_h
2012-01-23 W. James MacLean <wjmaclean@chromium.org>
[chromium] Add WebSolidColorLayer interface to draw non-textured color layers from Aura.
https://bugs.webkit.org/show_bug.cgi?id=75732
Reviewed by James Robinson.
* WebKit.gyp:
* WebKit.gypi:
* public/platform/WebSolidColorLayer.h: Added.
* src/WebSolidColorLayer.cpp: Added.
(WebKit::WebSolidColorLayer::create):
(WebKit::WebSolidColorLayer::WebSolidColorLayer):
(WebKit::WebSolidColorLayer::setBackgroundColor):
* src/WebSolidColorLayerImpl.cpp: Added.
(WebKit::WebSolidColorLayerImpl::create):
(WebKit::WebSolidColorLayerImpl::WebSolidColorLayerImpl):
(WebKit::WebSolidColorLayerImpl::~WebSolidColorLayerImpl):
* src/WebSolidColorLayerImpl.h: Added.
* tests/CCLayerTestCommon.cpp: Added.
(CCLayerTestCommon::completelyContains):
(CCLayerTestCommon::verifyQuadsExactlyCoverRect):
* tests/CCLayerTestCommon.h: Added.
* tests/CCSolidColorLayerImplTest.cpp: Added.
(CCLayerTestCommon::TEST):
* tests/CCTiledLayerImplTest.cpp:
2012-01-20 Pavel Feldman <pfeldman@google.com>
 
Web Inspector: PageAgent.open() dosen't belong to the protocol.
......
......@@ -326,6 +326,7 @@
'public/platform/WebSocketStreamError.h',
'public/platform/WebSocketStreamHandle.h',
'public/platform/WebSocketStreamHandleClient.h',
'public/platform/WebSolidColorLayer.h',
'public/platform/WebString.h',
'public/platform/WebThread.h',
'public/platform/WebThreadSafeData.h',
......@@ -638,6 +639,8 @@
'src/WebSocket.cpp',
'src/WebSocketImpl.cpp',
'src/WebSocketImpl.h',
'src/WebSolidColorLayer.cpp',
'src/WebSolidColorLayerImpl.cpp',
'src/WebSpeechInputControllerMockImpl.cpp',
'src/WebSpeechInputControllerMockImpl.h',
'src/WebSpeechInputResult.cpp',
......
......@@ -69,6 +69,8 @@
'tests/CCLayerIteratorTest.cpp',
'tests/CCLayerQuadTest.cpp',
'tests/CCLayerSorterTest.cpp',
'tests/CCLayerTestCommon.cpp',
'tests/CCLayerTestCommon.h',
'tests/CCLayerTreeHostCommonTest.cpp',
'tests/CCLayerTreeHostImplTest.cpp',
'tests/CCLayerTreeHostTest.cpp',
......@@ -78,6 +80,7 @@
'tests/CCSchedulerStateMachineTest.cpp',
'tests/CCSchedulerTestCommon.h',
'tests/CCSchedulerTest.cpp',
'tests/CCSolidColorLayerImplTest.cpp',
'tests/CCTiledLayerImplTest.cpp',
'tests/CCThreadTaskTest.cpp',
'tests/CCTimerTest.cpp',
......
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebSolidColorLayer_h
#define WebSolidColorLayer_h
#include "WebCommon.h"
#include "WebFloatRect.h"
#include "WebLayer.h"
namespace WebKit {
class WebSolidColorLayerImpl;
class WebSolidColorLayer : public WebLayer {
public:
WEBKIT_EXPORT static WebSolidColorLayer create();
WEBKIT_EXPORT void setBackgroundColor(const WebColor&);
#if WEBKIT_IMPLEMENTATION
WebSolidColorLayer(const WTF::PassRefPtr<WebSolidColorLayerImpl>&);
#endif
};
} // namespace WebKit
#endif // WebSolidColorLayer_h
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "platform/WebSolidColorLayer.h"
#include "WebSolidColorLayerImpl.h"
#include "platform/WebFloatRect.h"
namespace WebKit {
WebSolidColorLayer WebSolidColorLayer::create()
{
return WebSolidColorLayer(WebSolidColorLayerImpl::create());
}
WebSolidColorLayer::WebSolidColorLayer(const PassRefPtr<WebSolidColorLayerImpl>& node)
: WebLayer(node)
{
}
void WebSolidColorLayer::setBackgroundColor(const WebColor& color)
{
m_private->setBackgroundColor(color);
}
} // namespace WebKit
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "WebSolidColorLayerImpl.h"
using namespace WebCore;
namespace WebKit {
PassRefPtr<WebSolidColorLayerImpl> WebSolidColorLayerImpl::create()
{
return adoptRef(new WebSolidColorLayerImpl());
}
WebSolidColorLayerImpl::WebSolidColorLayerImpl()
: SolidColorLayerChromium()
{
setIsDrawable(true);
}
WebSolidColorLayerImpl::~WebSolidColorLayerImpl()
{
}
} // namespace WebKit
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebSolidColorLayerImpl_h
#define WebSolidColorLayerImpl_h
#include "SolidColorLayerChromium.h"
#include <wtf/PassRefPtr.h>
namespace WebKit {
class WebSolidColorLayerImpl : public WebCore::SolidColorLayerChromium {
public:
static PassRefPtr<WebSolidColorLayerImpl> create();
protected:
WebSolidColorLayerImpl();
virtual ~WebSolidColorLayerImpl();
};
} // namespace WebKit
#endif // WebSolidColorLayerImpl_h
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "CCLayerTestCommon.h"
#include <gtest/gtest.h>
#include <wtf/Vector.h>
using namespace WebCore;
namespace CCLayerTestCommon {
// Align with expected and actual output
const char* quadString = " Quad: ";
bool completelyContains(const Region& container, const IntRect& rect)
{
Region tester(rect);
Vector<IntRect> rects = container.rects();
for (size_t i = 0; i < rects.size(); ++i)
tester.subtract(rects[i]);
return tester.isEmpty();
}