Roll src/third_party/skia 18a240d:6fb0b67
[chromium-blink-merge.git] / courgette / adjustment_method.h
blob0ecf04d436fc9a8bdd5fdf18d82e12d51983207d
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COURGETTE_ADJUSTMENT_METHOD_H_
6 #define COURGETTE_ADJUSTMENT_METHOD_H_
8 #include "base/basictypes.h"
10 namespace courgette {
12 class AssemblyProgram;
14 class AdjustmentMethod {
15 public:
16 // Factory methods for making adjusters.
18 // Returns the adjustment method used in production.
19 static AdjustmentMethod* MakeProductionAdjustmentMethod() {
20 return MakeShingleAdjustmentMethod();
23 // Returns and adjustement method that makes no adjustments.
24 static AdjustmentMethod* MakeNullAdjustmentMethod();
26 // Returns the original adjustment method.
27 static AdjustmentMethod* MakeTrieAdjustmentMethod();
29 // Returns the new shingle tiling adjustment method.
30 static AdjustmentMethod* MakeShingleAdjustmentMethod();
32 // AdjustmentMethod interface:
34 // Adjusts |program| to increase similarity to |model|. |program| can be
35 // changed in any way provided that it still produces the same output when
36 // assembled.
37 virtual bool Adjust(const AssemblyProgram& model,
38 AssemblyProgram* program) = 0;
40 // Deletes 'this' adjustment method.
41 virtual void Destroy();
43 protected:
44 AdjustmentMethod() {}
45 virtual ~AdjustmentMethod() {}
47 DISALLOW_COPY_AND_ASSIGN(AdjustmentMethod);
50 } // namespace courgette
51 #endif // COURGETTE_ADJUSTMENT_METHOD_H_