Chromium Code Reviews| Index: chrome/browser/android/vr_shell/vr_controller_model.h |
| diff --git a/chrome/browser/android/vr_shell/vr_controller_model.h b/chrome/browser/android/vr_shell/vr_controller_model.h |
| index eb2bc88aadcc3eebd10cdecfe93b562bd3dd1422..227b36127e8e129d3ba1fb936a4af3accc19d573 100644 |
| --- a/chrome/browser/android/vr_shell/vr_controller_model.h |
| +++ b/chrome/browser/android/vr_shell/vr_controller_model.h |
| @@ -8,7 +8,8 @@ |
| #include <memory> |
| #include "chrome/browser/android/vr_shell/gltf_asset.h" |
| -#include "third_party/skia/include/core/SkBitmap.h" |
| +#include "third_party/skia/include/core/SkImage.h" |
| +#include "ui/gfx/geometry/point.h" |
| #include "ui/gl/gl_bindings.h" |
| namespace vr_shell { |
| @@ -24,17 +25,12 @@ class VrControllerModel { |
| STATE_COUNT, |
| }; |
| - // TODO(acondor): Remove these hardcoded paths once VrShell resources |
| - // are delivered through component updater. |
| - static constexpr char const kComponentName[] = "VrShell"; |
| - static constexpr char const kDefaultVersion[] = "0"; |
| - |
| - static constexpr char const kModelsDirectory[] = "models"; |
| - static constexpr char const kModelFilename[] = "controller.gltf"; |
| - static constexpr char const kTexturesDirectory[] = "tex"; |
| - static constexpr char const* kTextureFilenames[] = { |
| - "ddcontroller_idle.png", "ddcontroller_touchpad.png", |
| - "ddcontroller_app.png", "ddcontroller_system.png", |
| + struct Patch { |
| + sk_sp<SkImage> image; |
| + gfx::Point offset; |
| + Patch(); |
| + Patch(sk_sp<SkImage> image, const gfx::Point& offset); |
| + ~Patch(); |
|
cjgrant
2017/04/27 18:47:29
What happens if you just exclude the destructor he
acondor_
2017/04/27 19:01:19
Chromium codestyle check asked me to provide const
acondor_
2017/04/28 14:22:38
Actually, I don't need this class anymore.
|
| }; |
| explicit VrControllerModel( |
| @@ -50,14 +46,16 @@ class VrControllerModel { |
| const gltf::Accessor* IndicesAccessor() const; |
| const gltf::Accessor* PositionAccessor() const; |
| const gltf::Accessor* TextureCoordinateAccessor() const; |
| - void SetTexture(int state, std::unique_ptr<SkBitmap> bitmap); |
| - const SkBitmap* GetTexture(int state) const; |
| + void SetBaseTexture(sk_sp<SkImage> image); |
| + void SetTexturePatch(int state, sk_sp<SkImage> image); |
| + sk_sp<SkImage> GetTexture(int state) const; |
| static std::unique_ptr<VrControllerModel> LoadFromComponent(); |
| private: |
| std::unique_ptr<gltf::Asset> gltf_asset_; |
| - std::vector<std::unique_ptr<SkBitmap>> texture_bitmaps_; |
| + sk_sp<SkImage> base_texture_; |
| + sk_sp<SkImage> patches_[STATE_COUNT]; |
| std::vector<std::unique_ptr<gltf::Buffer>> buffers_; |
| const char* Buffer() const; |