18f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian/* 28f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * Copyright (C) 2009 Apple Inc. All rights reserved. 38f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * 48f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * Redistribution and use in source and binary forms, with or without 58f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * modification, are permitted provided that the following conditions 68f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * are met: 78f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * 1. Redistributions of source code must retain the above copyright 88f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * notice, this list of conditions and the following disclaimer. 98f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * 2. Redistributions in binary form must reproduce the above copyright 108f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * notice, this list of conditions and the following disclaimer in the 118f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * documentation and/or other materials provided with the distribution. 128f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * 138f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 148f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 158f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 168f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 178f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 188f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 198f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 208f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 218f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 228f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 238f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 248f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian */ 258f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 268f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian#ifndef GraphicsLayerClient_h 278f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian#define GraphicsLayerClient_h 288f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 298f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian#if USE(ACCELERATED_COMPOSITING) 308f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 318f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qiannamespace WebCore { 328f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 338f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qianclass GraphicsContext; 348f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qianclass GraphicsLayer; 357e6e4dd41950ef98c67ee99be2d67daf563009caShimeng (Simon) Wang#if PLATFORM(ANDROID) 367e6e4dd41950ef98c67ee99be2d67daf563009caShimeng (Simon) Wangclass RenderLayer; 377e6e4dd41950ef98c67ee99be2d67daf563009caShimeng (Simon) Wang#endif 388f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qianclass IntPoint; 398f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qianclass IntRect; 408f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qianclass FloatPoint; 418f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 428f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qianenum GraphicsLayerPaintingPhase { 43231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block GraphicsLayerPaintBackground = (1 << 0), 44231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block GraphicsLayerPaintForeground = (1 << 1), 45231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block GraphicsLayerPaintMask = (1 << 2), 46a15d30f54c6edc68da7e82c198b5916dd023ac4dNicolas Roard#if PLATFORM(ANDROID) 47a15d30f54c6edc68da7e82c198b5916dd023ac4dNicolas Roard GraphicsLayerPaintBackgroundDecorations = (1 << 3), 48a15d30f54c6edc68da7e82c198b5916dd023ac4dNicolas Roard#endif 49231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block GraphicsLayerPaintAll = (GraphicsLayerPaintBackground | GraphicsLayerPaintForeground | GraphicsLayerPaintMask) 508f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian}; 518f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 528f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qianenum AnimatedPropertyID { 538f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian AnimatedPropertyInvalid, 548f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian AnimatedPropertyWebkitTransform, 558f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian AnimatedPropertyOpacity, 568f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian AnimatedPropertyBackgroundColor 578f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian}; 588f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 598f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qianclass GraphicsLayerClient { 608f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qianpublic: 618f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian virtual ~GraphicsLayerClient() {} 628f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 637e6e4dd41950ef98c67ee99be2d67daf563009caShimeng (Simon) Wang#if PLATFORM(ANDROID) 647e6e4dd41950ef98c67ee99be2d67daf563009caShimeng (Simon) Wang virtual RenderLayer* owningLayer() const { return 0; } 657e6e4dd41950ef98c67ee99be2d67daf563009caShimeng (Simon) Wang#endif 667e6e4dd41950ef98c67ee99be2d67daf563009caShimeng (Simon) Wang 670bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch // Callback for when hardware-accelerated animation started. 688f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian virtual void notifyAnimationStarted(const GraphicsLayer*, double time) = 0; 690bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch 700bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch // Notification that a layer property changed that requires a subsequent call to syncCompositingState() 710bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch // to appear on the screen. 720bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdoch virtual void notifySyncRequired(const GraphicsLayer*) = 0; 738f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 748f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip) = 0; 75643ca7872b450ea4efacab6188849e5aac2ba161Steve Block 76643ca7872b450ea4efacab6188849e5aac2ba161Steve Block virtual bool showDebugBorders() const = 0; 77643ca7872b450ea4efacab6188849e5aac2ba161Steve Block virtual bool showRepaintCounter() const = 0; 788f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian}; 798f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 808f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian} // namespace WebCore 818f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 828f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian#endif // USE(ACCELERATED_COMPOSITING) 838f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian 848f72e70a9fd78eec56623b3a62e68f16b7b27e28Feng Qian#endif // GraphicsLayerClient_h 85