Home | History | Annotate | Download | only in animator
      1 /* libs/graphics/animator/SkDraw3D.h
      2 **
      3 ** Copyright 2006, The Android Open Source Project
      4 **
      5 ** Licensed under the Apache License, Version 2.0 (the "License");
      6 ** you may not use this file except in compliance with the License.
      7 ** You may obtain a copy of the License at
      8 **
      9 **     http://www.apache.org/licenses/LICENSE-2.0
     10 **
     11 ** Unless required by applicable law or agreed to in writing, software
     12 ** distributed under the License is distributed on an "AS IS" BASIS,
     13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14 ** See the License for the specific language governing permissions and
     15 ** limitations under the License.
     16 */
     17 
     18 #ifndef SkDraw3D_DEFINED
     19 #define SkDraw3D_DEFINED
     20 
     21 #include "SkCamera.h"
     22 #include "SkDrawable.h"
     23 #include "SkMemberInfo.h"
     24 
     25 class Sk3D_Patch;
     26 
     27 struct Sk3D_Point {
     28     DECLARE_NO_VIRTUALS_MEMBER_INFO(3D_Point);
     29     Sk3D_Point();
     30 private:
     31     SkPoint3D fPoint;
     32 };
     33 
     34 class Sk3D_Camera : public SkDrawable {
     35     DECLARE_MEMBER_INFO(3D_Camera);
     36     Sk3D_Camera();
     37     virtual ~Sk3D_Camera();
     38     virtual bool draw(SkAnimateMaker& );
     39 private:
     40     SkScalar hackWidth;
     41     SkScalar hackHeight;
     42     SkCamera3D fCamera;
     43     Sk3D_Patch* patch;
     44 };
     45 
     46 class Sk3D_Patch : public SkDisplayable {
     47     DECLARE_MEMBER_INFO(3D_Patch);
     48 private:
     49     virtual void executeFunction(SkDisplayable* , int index,
     50         SkTDArray<SkScriptValue>& parameters, SkDisplayTypes type,
     51         SkScriptValue* );
     52     virtual const SkFunctionParamType* getFunctionsParameters();
     53     SkPatch3D  fPatch;
     54     static const SkFunctionParamType fFunctionParameters[];
     55     friend class Sk3D_Camera;
     56 };
     57 
     58 #endif // SkDraw3D_DEFINED
     59 
     60