os/graphics/graphicsresourceservices/graphicsresourceadaptation/inc/sgimageimpl.inl
author sl
Tue, 10 Jun 2014 14:32:02 +0200 (2014-06-10)
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @internalComponent
    19 */
    20 
    21 #ifndef SGIMAGEIMPL_INL
    22 #define SGIMAGEIMPL_INL
    23 
    24 
    25 // XSgImageImplBase
    26 
    27 inline XSgImageImplBase::XSgImageImplBase(XSgDriverImpl& aDriverImpl)
    28 	: XSgBase(aDriverImpl)
    29 	{}
    30 
    31 
    32 inline XSgImageImplBase::XSgImageImplBase(XSgDriverImpl& aDriverImpl, const TSgDrawableId& aId)
    33 	: XSgBase(aDriverImpl), iId(aId)
    34 	{}
    35 
    36 
    37 inline const TSgImageMetaData& XSgImageImplBase::MetaData() const
    38 	{
    39 	return iState->MetaData();
    40 	}
    41 
    42 
    43 // XSgImageStateBase
    44 
    45 inline XSgImageStateBase::XSgImageStateBase(XSgDriverImpl& aDriverImpl)
    46 	: XSgBase(aDriverImpl)
    47 	{}
    48 
    49 
    50 inline XSgImageStateBase::XSgImageStateBase(XSgDriverImpl& aDriverImpl, TInt aDataStride)
    51 	: XSgBase(aDriverImpl), iDataStride(aDataStride)
    52 	{}
    53 
    54 
    55 inline TInt XSgImageStateBase::DataStride() const
    56 	{
    57 	return iDataStride;
    58 	}
    59 
    60 
    61 #ifndef SYMBIAN_GRAPHICS_USE_GPU
    62 
    63 // TSgImageId_SwLocal
    64 
    65 inline TBool TSgImageId_SwLocal::IsMatch(const TSgDrawableId& aId)
    66 	{
    67 	return reinterpret_cast<const TSgImageId_SwLocal&>(aId).iMinusOne == KErrNotFound;
    68 	}
    69 
    70 
    71 // XSgImageImpl_SwLocal
    72 
    73 inline XSgImageImpl_SwLocal::XSgImageImpl_SwLocal(XSgDriverImpl& aDriverImpl, const TSgDrawableId& aId)
    74 	: XSgImageImplBase(aDriverImpl, aId)
    75 	{}
    76 
    77 
    78 inline XSgImageImpl_SwLocal::XSgImageImpl_SwLocal(const XSgImageImpl_SwLocal& aImage, TUint32 aFlags)
    79 	: XSgImageImplBase(aImage, aFlags)
    80 	{}
    81 
    82 #endif
    83 
    84 
    85 // TSgImageId_SurfaceManager
    86 
    87 inline TBool TSgImageId_SurfaceManager::IsMatch(const TSgDrawableId& aId)
    88 	{
    89 	return reinterpret_cast<const TSgImageId_SurfaceManager&>(aId).iBufferIndex >= 0
    90 	       && reinterpret_cast<const TSgImageId_SurfaceManager&>(aId).iMetaDataIndex >= 0;
    91 	}
    92 
    93 
    94 // XSgImageImpl_SurfaceManager
    95 
    96 inline XSgImageImpl_SurfaceManager::XSgImageImpl_SurfaceManager(XSgDriverImpl& aDriverImpl)
    97 	: XSgImageImplBase(aDriverImpl)
    98 	{}
    99 
   100 
   101 inline XSgImageImpl_SurfaceManager::XSgImageImpl_SurfaceManager(XSgDriverImpl& aDriverImpl, const TSgDrawableId& aId)
   102 	: XSgImageImplBase(aDriverImpl, aId)
   103 	{}
   104 
   105 
   106 inline XSgImageImpl_SurfaceManager::XSgImageImpl_SurfaceManager(const XSgImageImpl_SurfaceManager& aImage, TUint32 aFlags)
   107 	: XSgImageImplBase(aImage, aFlags)
   108 	{}
   109 
   110 
   111 // XSgImageState_SurfaceManager
   112 
   113 inline XSgImageState_SurfaceManager::XSgImageState_SurfaceManager(XSgDriverImpl& aDriverImpl)
   114 	: XSgImageStateBase(aDriverImpl)
   115 	{}
   116 
   117 
   118 inline const TSurfaceId& XSgImageState_SurfaceManager::SurfaceId() const
   119 	{
   120 	return iSurfaceId;
   121 	}
   122 
   123 
   124 inline const RChunk& XSgImageState_SurfaceManager::DataChunk() const
   125 	{
   126 	return iDataChunk;
   127 	}
   128 
   129 
   130 inline TInt XSgImageState_SurfaceManager::DataOffset() const
   131 	{
   132 	return iDataOffset;
   133 	}
   134 
   135 
   136 #endif // SGIMAGEIMPL_INL