blob: 5ad93f6a97dbcf14ca82eb78605262ecdaad5524 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_GFX_TRANSFORM_SKIA_H_
#define UI_GFX_TRANSFORM_SKIA_H_
#pragma once
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "ui/gfx/transform.h"
class SkMatrix;
namespace gfx {
class CanvasSkia;
}
namespace ui {
// Transformation using skia transformation matrices.
class TransformSkia : public Transform {
public:
TransformSkia();
virtual ~TransformSkia();
// Overridden from ui::Transform
virtual void SetRotate(float degree) OVERRIDE;
virtual void SetScaleX(float x) OVERRIDE;
virtual void SetScaleY(float y) OVERRIDE;
virtual void SetScale(float x, float y) OVERRIDE;
virtual void SetTranslateX(float x) OVERRIDE;
virtual void SetTranslateY(float y) OVERRIDE;
virtual void SetTranslate(float x, float y) OVERRIDE;
virtual void ConcatRotate(float degree) OVERRIDE;
virtual void ConcatScale(float x, float y) OVERRIDE;
virtual void ConcatTranslate(float x, float y) OVERRIDE;
virtual bool ConcatTransform(const Transform& transform) OVERRIDE;
virtual bool HasChange() const OVERRIDE;
virtual bool TransformPoint(gfx::Point* point) OVERRIDE;
virtual bool TransformPointReverse(gfx::Point* point) OVERRIDE;
virtual bool TransformRect(gfx::Rect* rect) OVERRIDE;
private:
friend class gfx::CanvasSkia;
scoped_ptr<SkMatrix> matrix_;
DISALLOW_COPY_AND_ASSIGN(TransformSkia);
};
} // namespace ui
#endif // UI_GFX_TRANSFORM_SKIA_H_
|