blob: 5f066ba65f4afcc127b76acaba94d329cf597502 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
2/*
3 * Copyright 2006 The Android Open Source Project
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
reed@android.com8a1c16f2008-12-17 15:59:43 +00009
10#ifndef SkDraw3D_DEFINED
11#define SkDraw3D_DEFINED
12
13#include "SkCamera.h"
reed986ca612014-11-26 08:50:45 -080014#include "SkADrawable.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +000015#include "SkMemberInfo.h"
16
17class Sk3D_Patch;
18
19struct Sk3D_Point {
20 DECLARE_NO_VIRTUALS_MEMBER_INFO(3D_Point);
21 Sk3D_Point();
22private:
23 SkPoint3D fPoint;
24};
25
reed986ca612014-11-26 08:50:45 -080026class Sk3D_Camera : public SkADrawable {
reed@android.com8a1c16f2008-12-17 15:59:43 +000027 DECLARE_MEMBER_INFO(3D_Camera);
28 Sk3D_Camera();
29 virtual ~Sk3D_Camera();
mtklein72c9faa2015-01-09 10:06:39 -080030 bool draw(SkAnimateMaker& ) SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +000031private:
32 SkScalar hackWidth;
33 SkScalar hackHeight;
34 SkCamera3D fCamera;
35 Sk3D_Patch* patch;
36};
37
38class Sk3D_Patch : public SkDisplayable {
39 DECLARE_MEMBER_INFO(3D_Patch);
40private:
rmistry@google.comd6176b02012-08-23 18:14:13 +000041 virtual void executeFunction(SkDisplayable* , int index,
reed@android.com8a1c16f2008-12-17 15:59:43 +000042 SkTDArray<SkScriptValue>& parameters, SkDisplayTypes type,
tfarinaaa458fb2015-01-05 17:18:51 -080043 SkScriptValue* ) SK_OVERRIDE;
mtklein72c9faa2015-01-09 10:06:39 -080044 const SkFunctionParamType* getFunctionsParameters() SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +000045 SkPatch3D fPatch;
46 static const SkFunctionParamType fFunctionParameters[];
47 friend class Sk3D_Camera;
48};
49
50#endif // SkDraw3D_DEFINED