Move SkCamera.h to client_utils/android
Android still uses this https://developer.android.com/reference/android/graphics/Camera but no other client does. This adds a little adaption layer until Android is updated to use the View3D version. Move SkCamera.h to View3D.h. Change names to android::skia::CLASS instead of SkCLASS. (3DView is not a valid class name, so rename it to View3D.) Forward-declare SkMatrix. Do not override SkNoncopyable - just delete the copy constructor/operator=. Make fU and fV private in Patch3D. Make Sk3DView override View3D temporarily until Android can be switched over to the new class. (View3D from http://review.skia.org/291371) I made Patch3D and Camera3D be private classes as they are currently not used by Android and wanted to constrain the exposed API as much as possible. Change-Id: Ibde45478421feeb610e045205c3f20c0e5b1567e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532456 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
parent
cb76656bb2
commit
8a54d86c78
3
BUILD.gn
3
BUILD.gn
@ -360,11 +360,14 @@ optional("android_utils") {
|
||||
"client_utils/android/BRDAllocator.h",
|
||||
"client_utils/android/BitmapRegionDecoder.h",
|
||||
"client_utils/android/FrontBufferedStream.h",
|
||||
"client_utils/android/SkCamera.h",
|
||||
"client_utils/android/View3D.h",
|
||||
]
|
||||
public_defines = [ "SK_ENABLE_ANDROID_UTILS" ]
|
||||
sources = [
|
||||
"client_utils/android/BitmapRegionDecoder.cpp",
|
||||
"client_utils/android/FrontBufferedStream.cpp",
|
||||
"client_utils/android/View3D.cpp",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,12 @@ Skia Graphics Release Notes
|
||||
|
||||
This file includes a list of high level updates for each milestone release.
|
||||
|
||||
Milestone 103
|
||||
-------------
|
||||
* SkCamera, SkPatch3D, Sk3DView have been moved to client_utils/android and renamed to
|
||||
Camera, Patch3D, and View3D respectively.
|
||||
|
||||
|
||||
Milestone 102
|
||||
-------------
|
||||
* Add glGetFloatv and glSamplerParameterf to GrGLInterface.
|
||||
|
3
client_utils/README.md
Normal file
3
client_utils/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
This folder contains code that at one point may have been part of the Skia API, but ended up
|
||||
being very specific to a single client. Thus, we removed it from our more general purpose API,
|
||||
but kept the functionality here for the one client that needs it.
|
11
client_utils/android/SkCamera.h
Normal file
11
client_utils/android/SkCamera.h
Normal file
@ -0,0 +1,11 @@
|
||||
/*
|
||||
* Copyright 2022 Google LLC
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "client_utils/android/View3D.h"
|
||||
|
||||
// Temporary, until Android updates to the new API
|
||||
using Sk3DView = android::skia::View3D;
|
@ -5,7 +5,13 @@
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "include/utils/SkCamera.h"
|
||||
#include "client_utils/android/View3D.h"
|
||||
|
||||
#include "include/core/SkCanvas.h"
|
||||
#include "include/core/SkMatrix.h"
|
||||
|
||||
namespace android {
|
||||
namespace skia {
|
||||
|
||||
static SkScalar SkScalarDotDiv(int count, const SkScalar a[], int step_a,
|
||||
const SkScalar b[], int step_b,
|
||||
@ -21,19 +27,19 @@ static SkScalar SkScalarDotDiv(int count, const SkScalar a[], int step_a,
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
SkPatch3D::SkPatch3D() {
|
||||
Patch3D::Patch3D() {
|
||||
this->reset();
|
||||
}
|
||||
|
||||
void SkPatch3D::reset() {
|
||||
void Patch3D::reset() {
|
||||
fOrigin = {0, 0, 0};
|
||||
fU = {SK_Scalar1, 0, 0};
|
||||
fV = {0, -SK_Scalar1, 0};
|
||||
}
|
||||
|
||||
void SkPatch3D::transform(const SkM44& m, SkPatch3D* dst) const {
|
||||
void Patch3D::transform(const SkM44& m, Patch3D* dst) const {
|
||||
if (dst == nullptr) {
|
||||
dst = (SkPatch3D*)this;
|
||||
dst = (Patch3D*)this;
|
||||
}
|
||||
dst->fU = m * fU;
|
||||
dst->fV = m * fV;
|
||||
@ -41,7 +47,7 @@ void SkPatch3D::transform(const SkM44& m, SkPatch3D* dst) const {
|
||||
dst->fOrigin = {x, y, z};
|
||||
}
|
||||
|
||||
SkScalar SkPatch3D::dotWith(SkScalar dx, SkScalar dy, SkScalar dz) const {
|
||||
SkScalar Patch3D::dotWith(SkScalar dx, SkScalar dy, SkScalar dz) const {
|
||||
SkScalar cx = fU.y * fV.z - fU.z * fV.y;
|
||||
SkScalar cy = fU.z * fV.x - fU.x * fV.y;
|
||||
SkScalar cz = fU.x * fV.y - fU.y * fV.x;
|
||||
@ -51,11 +57,11 @@ SkScalar SkPatch3D::dotWith(SkScalar dx, SkScalar dy, SkScalar dz) const {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
SkCamera3D::SkCamera3D() {
|
||||
Camera3D::Camera3D() {
|
||||
this->reset();
|
||||
}
|
||||
|
||||
void SkCamera3D::reset() {
|
||||
void Camera3D::reset() {
|
||||
fLocation = {0, 0, -SkIntToScalar(576)}; // 8 inches backward
|
||||
fAxis = {0, 0, SK_Scalar1}; // forward
|
||||
fZenith = {0, -SK_Scalar1, 0}; // up
|
||||
@ -65,11 +71,11 @@ void SkCamera3D::reset() {
|
||||
fNeedToUpdate = true;
|
||||
}
|
||||
|
||||
void SkCamera3D::update() {
|
||||
void Camera3D::update() {
|
||||
fNeedToUpdate = true;
|
||||
}
|
||||
|
||||
void SkCamera3D::doUpdate() const {
|
||||
void Camera3D::doUpdate() const {
|
||||
SkV3 axis, zenith, cross;
|
||||
|
||||
// construct a orthonormal basis of cross (x), zenith (y), and axis (z)
|
||||
@ -110,7 +116,7 @@ void SkCamera3D::doUpdate() const {
|
||||
}
|
||||
}
|
||||
|
||||
void SkCamera3D::patchToMatrix(const SkPatch3D& quilt, SkMatrix* matrix) const {
|
||||
void Camera3D::patchToMatrix(const Patch3D& quilt, SkMatrix* matrix) const {
|
||||
if (fNeedToUpdate) {
|
||||
this->doUpdate();
|
||||
fNeedToUpdate = false;
|
||||
@ -149,11 +155,11 @@ void SkCamera3D::patchToMatrix(const SkPatch3D& quilt, SkMatrix* matrix) const {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Sk3DView::Sk3DView() {
|
||||
View3D::View3D() {
|
||||
fRec = &fInitialRec;
|
||||
}
|
||||
|
||||
Sk3DView::~Sk3DView() {
|
||||
View3D::~View3D() {
|
||||
Rec* rec = fRec;
|
||||
while (rec != &fInitialRec) {
|
||||
Rec* next = rec->fNext;
|
||||
@ -162,22 +168,21 @@ Sk3DView::~Sk3DView() {
|
||||
}
|
||||
}
|
||||
|
||||
void Sk3DView::save() {
|
||||
void View3D::save() {
|
||||
Rec* rec = new Rec;
|
||||
rec->fNext = fRec;
|
||||
rec->fMatrix = fRec->fMatrix;
|
||||
fRec = rec;
|
||||
}
|
||||
|
||||
void Sk3DView::restore() {
|
||||
void View3D::restore() {
|
||||
SkASSERT(fRec != &fInitialRec);
|
||||
Rec* next = fRec->fNext;
|
||||
delete fRec;
|
||||
fRec = next;
|
||||
}
|
||||
|
||||
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
|
||||
void Sk3DView::setCameraLocation(SkScalar x, SkScalar y, SkScalar z) {
|
||||
void View3D::setCameraLocation(SkScalar x, SkScalar y, SkScalar z) {
|
||||
// the camera location is passed in inches, set in pt
|
||||
SkScalar lz = z * 72.0f;
|
||||
fCamera.fLocation = {x * 72.0f, y * 72.0f, lz};
|
||||
@ -186,54 +191,54 @@ void Sk3DView::setCameraLocation(SkScalar x, SkScalar y, SkScalar z) {
|
||||
|
||||
}
|
||||
|
||||
SkScalar Sk3DView::getCameraLocationX() const {
|
||||
SkScalar View3D::getCameraLocationX() const {
|
||||
return fCamera.fLocation.x / 72.0f;
|
||||
}
|
||||
|
||||
SkScalar Sk3DView::getCameraLocationY() const {
|
||||
SkScalar View3D::getCameraLocationY() const {
|
||||
return fCamera.fLocation.y / 72.0f;
|
||||
}
|
||||
|
||||
SkScalar Sk3DView::getCameraLocationZ() const {
|
||||
SkScalar View3D::getCameraLocationZ() const {
|
||||
return fCamera.fLocation.z / 72.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
void Sk3DView::translate(SkScalar x, SkScalar y, SkScalar z) {
|
||||
void View3D::translate(SkScalar x, SkScalar y, SkScalar z) {
|
||||
fRec->fMatrix.preTranslate(x, y, z);
|
||||
}
|
||||
|
||||
void Sk3DView::rotateX(SkScalar deg) {
|
||||
void View3D::rotateX(SkScalar deg) {
|
||||
fRec->fMatrix.preConcat(SkM44::Rotate({1, 0, 0}, deg * SK_ScalarPI / 180));
|
||||
}
|
||||
|
||||
void Sk3DView::rotateY(SkScalar deg) {
|
||||
void View3D::rotateY(SkScalar deg) {
|
||||
fRec->fMatrix.preConcat(SkM44::Rotate({0,-1, 0}, deg * SK_ScalarPI / 180));
|
||||
}
|
||||
|
||||
void Sk3DView::rotateZ(SkScalar deg) {
|
||||
void View3D::rotateZ(SkScalar deg) {
|
||||
fRec->fMatrix.preConcat(SkM44::Rotate({0, 0, 1}, deg * SK_ScalarPI / 180));
|
||||
}
|
||||
|
||||
SkScalar Sk3DView::dotWithNormal(SkScalar x, SkScalar y, SkScalar z) const {
|
||||
SkPatch3D patch;
|
||||
SkScalar View3D::dotWithNormal(SkScalar x, SkScalar y, SkScalar z) const {
|
||||
Patch3D patch;
|
||||
patch.transform(fRec->fMatrix);
|
||||
return patch.dotWith(x, y, z);
|
||||
}
|
||||
|
||||
void Sk3DView::getMatrix(SkMatrix* matrix) const {
|
||||
void View3D::getMatrix(SkMatrix* matrix) const {
|
||||
if (matrix != nullptr) {
|
||||
SkPatch3D patch;
|
||||
Patch3D patch;
|
||||
patch.transform(fRec->fMatrix);
|
||||
fCamera.patchToMatrix(patch, matrix);
|
||||
}
|
||||
}
|
||||
|
||||
#include "include/core/SkCanvas.h"
|
||||
|
||||
void Sk3DView::applyToCanvas(SkCanvas* canvas) const {
|
||||
void View3D::applyToCanvas(SkCanvas* canvas) const {
|
||||
SkMatrix matrix;
|
||||
|
||||
this->getMatrix(&matrix);
|
||||
canvas->concat(matrix);
|
||||
}
|
||||
|
||||
} // namespace skia
|
||||
} // namespace android
|
@ -7,27 +7,23 @@
|
||||
|
||||
// Inspired by Rob Johnson's most excellent QuickDraw GX sample code
|
||||
|
||||
#ifndef SkCamera_DEFINED
|
||||
#define SkCamera_DEFINED
|
||||
#ifndef View3D_DEFINED
|
||||
#define View3D_DEFINED
|
||||
|
||||
#include "include/core/SkM44.h"
|
||||
#include "include/core/SkMatrix.h"
|
||||
#include "include/private/SkNoncopyable.h"
|
||||
|
||||
// NOTE -- This entire header / impl is deprecated, and will be removed from Skia soon.
|
||||
//
|
||||
// Skia now has support for a 4x matrix (SkM44) in SkCanvas.
|
||||
//
|
||||
|
||||
class SkCanvas;
|
||||
class SkMatrix;
|
||||
|
||||
// DEPRECATED
|
||||
class SkPatch3D {
|
||||
public:
|
||||
SkPatch3D();
|
||||
namespace android {
|
||||
namespace skia {
|
||||
|
||||
class Patch3D {
|
||||
private:
|
||||
Patch3D();
|
||||
|
||||
void reset();
|
||||
void transform(const SkM44&, SkPatch3D* dst = nullptr) const;
|
||||
void transform(const SkM44&, Patch3D* dst = nullptr) const;
|
||||
|
||||
// dot a unit vector with the patch's normal
|
||||
SkScalar dotWith(SkScalar dx, SkScalar dy, SkScalar dz) const;
|
||||
@ -35,44 +31,38 @@ public:
|
||||
return this->dotWith(v.x, v.y, v.z);
|
||||
}
|
||||
|
||||
// deprecated, but still here for animator (for now)
|
||||
void rotate(SkScalar /*x*/, SkScalar /*y*/, SkScalar /*z*/) {}
|
||||
void rotateDegrees(SkScalar /*x*/, SkScalar /*y*/, SkScalar /*z*/) {}
|
||||
|
||||
private:
|
||||
public: // make public for SkDraw3D for now
|
||||
SkV3 fU, fV;
|
||||
SkV3 fOrigin;
|
||||
SkV3 fU, fV;
|
||||
|
||||
friend class SkCamera3D;
|
||||
friend class Camera3D;
|
||||
friend class View3D;
|
||||
};
|
||||
|
||||
// DEPRECATED
|
||||
class SkCamera3D {
|
||||
public:
|
||||
SkCamera3D();
|
||||
class Camera3D {
|
||||
private:
|
||||
Camera3D();
|
||||
|
||||
void reset();
|
||||
void update();
|
||||
void patchToMatrix(const SkPatch3D&, SkMatrix* matrix) const;
|
||||
void patchToMatrix(const Patch3D&, SkMatrix* matrix) const;
|
||||
|
||||
SkV3 fLocation; // origin of the camera's space
|
||||
SkV3 fAxis; // view direction
|
||||
SkV3 fZenith; // up direction
|
||||
SkV3 fObserver; // eye position (may not be the same as the origin)
|
||||
|
||||
private:
|
||||
mutable SkMatrix fOrientation;
|
||||
mutable bool fNeedToUpdate;
|
||||
|
||||
void doUpdate() const;
|
||||
|
||||
friend class View3D;
|
||||
};
|
||||
|
||||
// DEPRECATED
|
||||
class SK_API Sk3DView : SkNoncopyable {
|
||||
class View3D {
|
||||
public:
|
||||
Sk3DView();
|
||||
~Sk3DView();
|
||||
View3D();
|
||||
~View3D();
|
||||
|
||||
void save();
|
||||
void restore();
|
||||
@ -82,12 +72,10 @@ public:
|
||||
void rotateY(SkScalar deg);
|
||||
void rotateZ(SkScalar deg);
|
||||
|
||||
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
|
||||
void setCameraLocation(SkScalar x, SkScalar y, SkScalar z);
|
||||
SkScalar getCameraLocationX() const;
|
||||
SkScalar getCameraLocationY() const;
|
||||
SkScalar getCameraLocationZ() const;
|
||||
#endif
|
||||
|
||||
void getMatrix(SkMatrix*) const;
|
||||
void applyToCanvas(SkCanvas*) const;
|
||||
@ -99,9 +87,13 @@ private:
|
||||
Rec* fNext;
|
||||
SkM44 fMatrix;
|
||||
};
|
||||
Rec* fRec;
|
||||
Rec fInitialRec;
|
||||
SkCamera3D fCamera;
|
||||
};
|
||||
Rec* fRec;
|
||||
Rec fInitialRec;
|
||||
Camera3D fCamera;
|
||||
|
||||
#endif
|
||||
View3D(const View3D&) = delete;
|
||||
View3D& operator=(const View3D&) = delete;
|
||||
};
|
||||
} // namespace skia
|
||||
} // namespace android
|
||||
#endif // View3D_DEFINED
|
@ -20,7 +20,6 @@ samples_sources = [
|
||||
"$_samplecode/SampleArc.cpp",
|
||||
"$_samplecode/SampleAtlas.cpp",
|
||||
"$_samplecode/SampleAudio.cpp",
|
||||
"$_samplecode/SampleCamera.cpp",
|
||||
"$_samplecode/SampleChart.cpp",
|
||||
"$_samplecode/SampleChineseFling.cpp",
|
||||
"$_samplecode/SampleCircle.cpp",
|
||||
|
@ -10,7 +10,6 @@ _include = get_path_info("../include", "abspath")
|
||||
skia_utils_public = [
|
||||
"$_include/utils/SkAnimCodecPlayer.h",
|
||||
"$_include/utils/SkBase64.h",
|
||||
"$_include/utils/SkCamera.h",
|
||||
"$_include/utils/SkCanvasStateUtils.h",
|
||||
"$_include/utils/SkCustomTypeface.h",
|
||||
"$_include/utils/SkEventTracer.h",
|
||||
@ -35,7 +34,6 @@ skia_utils_sources = [
|
||||
"$_src/utils/SkBlitterTrace.h",
|
||||
"$_src/utils/SkBlitterTraceCommon.h",
|
||||
"$_src/utils/SkCallableTraits.h",
|
||||
"$_src/utils/SkCamera.cpp",
|
||||
"$_src/utils/SkCanvasStack.cpp",
|
||||
"$_src/utils/SkCanvasStack.h",
|
||||
"$_src/utils/SkCanvasStateUtils.cpp",
|
||||
|
@ -16,17 +16,6 @@ generated_cc_atom(
|
||||
deps = ["//include/core:SkTypes_hdr"],
|
||||
)
|
||||
|
||||
generated_cc_atom(
|
||||
name = "SkCamera_hdr",
|
||||
hdrs = ["SkCamera.h"],
|
||||
visibility = ["//:__subpackages__"],
|
||||
deps = [
|
||||
"//include/core:SkM44_hdr",
|
||||
"//include/core:SkMatrix_hdr",
|
||||
"//include/private:SkNoncopyable_hdr",
|
||||
],
|
||||
)
|
||||
|
||||
generated_cc_atom(
|
||||
name = "SkCanvasStateUtils_hdr",
|
||||
hdrs = ["SkCanvasStateUtils.h"],
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "include/core/SkPath.h"
|
||||
#include "include/core/SkPoint3.h"
|
||||
#include "include/pathops/SkPathOps.h"
|
||||
#include "include/utils/SkCamera.h"
|
||||
#include "include/utils/SkShadowUtils.h"
|
||||
#include "samplecode/Sample.h"
|
||||
#include "src/core/SkBlurMask.h"
|
||||
@ -18,6 +17,10 @@
|
||||
#include "tools/ToolUtils.h"
|
||||
#include "tools/timer/TimeUtils.h"
|
||||
|
||||
#ifdef SK_ENABLE_ANDROID_UTILS
|
||||
#include "client_utils/android/View3D.h"
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class ShadowsView : public Sample {
|
||||
@ -265,12 +268,13 @@ class ShadowsView : public Sample {
|
||||
this->drawShadowedPath(canvas, tmpPath, zPlaneParams, paint, .1f,
|
||||
lightPos, kLightWidth, .5f);
|
||||
|
||||
#ifdef SK_ENABLE_ANDROID_UTILS
|
||||
// perspective paths
|
||||
SkPoint pivot = SkPoint::Make(fWideRectPath.getBounds().width()/2,
|
||||
fWideRectPath.getBounds().height()/2);
|
||||
SkPoint translate = SkPoint::Make(100, 450);
|
||||
paint.setColor(SK_ColorWHITE);
|
||||
Sk3DView view;
|
||||
android::skia::View3D view;
|
||||
view.save();
|
||||
view.rotateX(fAnimAngle);
|
||||
SkMatrix persp;
|
||||
@ -315,6 +319,7 @@ class ShadowsView : public Sample {
|
||||
std::max(1.0f, 8 + fZDelta) + SkScalarSin(radians)*pivot.fX);
|
||||
this->drawShadowedPath(canvas, fStarPath, zPlaneParams, paint, .1f,
|
||||
lightPos, kLightWidth, .5f);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool onAnimate(double nanos) override {
|
||||
|
@ -1,75 +0,0 @@
|
||||
/*
|
||||
* Copyright 2011 Google Inc.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "include/core/SkCanvas.h"
|
||||
#include "include/core/SkImage.h"
|
||||
#include "include/core/SkShader.h"
|
||||
#include "include/core/SkString.h"
|
||||
#include "include/utils/SkCamera.h"
|
||||
#include "samplecode/DecodeFile.h"
|
||||
#include "samplecode/Sample.h"
|
||||
#include "src/effects/SkEmbossMaskFilter.h"
|
||||
#include "tools/Resources.h"
|
||||
#include "tools/timer/TimeUtils.h"
|
||||
|
||||
namespace {
|
||||
class CameraView : public Sample {
|
||||
SkTArray<sk_sp<SkShader>> fShaders;
|
||||
int fShaderIndex = 0;
|
||||
bool fFrontFace = false;
|
||||
SkScalar fRX = 0;
|
||||
SkScalar fRY = 0;
|
||||
|
||||
SkString name() override { return SkString("Camera"); }
|
||||
|
||||
void onOnceBeforeDraw() override {
|
||||
for (const char* resource : {
|
||||
"images/mandrill_512_q075.jpg",
|
||||
"images/dog.jpg",
|
||||
"images/gamut.png",
|
||||
}) {
|
||||
SkBitmap bm;
|
||||
if (GetResourceAsBitmap(resource, &bm)) {
|
||||
SkRect src = { 0, 0, SkIntToScalar(bm.width()), SkIntToScalar(bm.height()) };
|
||||
SkRect dst = { -150, -150, 150, 150 };
|
||||
fShaders.push_back(bm.makeShader(SkSamplingOptions(SkFilterMode::kLinear),
|
||||
SkMatrix::RectToRect(src, dst)));
|
||||
}
|
||||
}
|
||||
this->setBGColor(0xFFDDDDDD);
|
||||
}
|
||||
|
||||
void onDrawContent(SkCanvas* canvas) override {
|
||||
if (fShaders.count() > 0) {
|
||||
canvas->translate(this->width()/2, this->height()/2);
|
||||
|
||||
Sk3DView view;
|
||||
view.rotateX(fRX);
|
||||
view.rotateY(fRY);
|
||||
view.applyToCanvas(canvas);
|
||||
|
||||
bool frontFace = view.dotWithNormal(0, 0, SK_Scalar1) < 0;
|
||||
if (frontFace != fFrontFace) {
|
||||
fFrontFace = frontFace;
|
||||
fShaderIndex = (fShaderIndex + 1) % fShaders.count();
|
||||
}
|
||||
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
paint.setShader(fShaders[fShaderIndex]);
|
||||
SkRect r = { -150, -150, 150, 150 };
|
||||
canvas->drawRoundRect(r, 30, 30, paint);
|
||||
}
|
||||
}
|
||||
|
||||
bool onAnimate(double nanos) override {
|
||||
fRY = nanos ? TimeUtils::Scaled(1e-9 * nanos, 90, 360) : 0;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
} // namespace
|
||||
DEF_SAMPLE( return new CameraView(); )
|
@ -16,7 +16,6 @@
|
||||
#include "include/core/SkTime.h"
|
||||
#include "include/core/SkTypeface.h"
|
||||
#include "include/effects/SkGradientShader.h"
|
||||
#include "include/utils/SkCamera.h"
|
||||
#include "samplecode/Sample.h"
|
||||
#include "src/utils/SkUTF.h"
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "include/core/SkPath.h"
|
||||
#include "include/core/SkPoint3.h"
|
||||
#include "include/pathops/SkPathOps.h"
|
||||
#include "include/utils/SkCamera.h"
|
||||
#include "include/utils/SkShadowUtils.h"
|
||||
#include "samplecode/Sample.h"
|
||||
#include "src/core/SkBlurMask.h"
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "include/core/SkPath.h"
|
||||
#include "include/core/SkPoint3.h"
|
||||
#include "include/pathops/SkPathOps.h"
|
||||
#include "include/utils/SkCamera.h"
|
||||
#include "include/utils/SkShadowUtils.h"
|
||||
#include "samplecode/Sample.h"
|
||||
#include "src/core/SkBlurMask.h"
|
||||
|
@ -8,7 +8,6 @@ cc_library(
|
||||
deps = [
|
||||
":SkAnimCodecPlayer_src",
|
||||
":SkBase64_src",
|
||||
":SkCamera_src",
|
||||
":SkCanvasStack_src",
|
||||
":SkCanvasStateUtils_src",
|
||||
":SkCharToGlyphCache_src",
|
||||
@ -96,16 +95,6 @@ generated_cc_atom(
|
||||
visibility = ["//:__subpackages__"],
|
||||
)
|
||||
|
||||
generated_cc_atom(
|
||||
name = "SkCamera_src",
|
||||
srcs = ["SkCamera.cpp"],
|
||||
visibility = ["//:__subpackages__"],
|
||||
deps = [
|
||||
"//include/core:SkCanvas_hdr",
|
||||
"//include/utils:SkCamera_hdr",
|
||||
],
|
||||
)
|
||||
|
||||
generated_cc_atom(
|
||||
name = "SkCanvasStack_hdr",
|
||||
hdrs = ["SkCanvasStack.h"],
|
||||
|
Loading…
Reference in New Issue
Block a user