| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_PLAYBACK_RASTER_SOURCE_H_ | 5 #ifndef CC_PLAYBACK_RASTER_SOURCE_H_ |
| 6 #define CC_PLAYBACK_RASTER_SOURCE_H_ | 6 #define CC_PLAYBACK_RASTER_SOURCE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
| 12 #include "cc/debug/traced_value.h" | 12 #include "cc/debug/traced_value.h" |
| 13 #include "cc/playback/discardable_image_map.h" | 13 #include "cc/playback/discardable_image_map.h" |
| 14 #include "skia/ext/refptr.h" | 14 #include "skia/ext/refptr.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
| 16 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
| 17 #include "ui/gfx/geometry/size.h" | 17 #include "ui/gfx/geometry/size.h" |
| 18 | 18 |
| 19 class SkCanvas; | 19 class SkCanvas; |
| 20 class SkPicture; | 20 class SkPicture; |
| 21 | 21 |
| 22 namespace cc { | 22 namespace cc { |
| 23 | 23 |
| 24 class ImageDecodeController; |
| 24 class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> { | 25 class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> { |
| 25 public: | 26 public: |
| 26 struct CC_EXPORT SolidColorAnalysis { | 27 struct CC_EXPORT SolidColorAnalysis { |
| 27 SolidColorAnalysis() | 28 SolidColorAnalysis() |
| 28 : is_solid_color(false), solid_color(SK_ColorTRANSPARENT) {} | 29 : is_solid_color(false), solid_color(SK_ColorTRANSPARENT) {} |
| 29 ~SolidColorAnalysis() {} | 30 ~SolidColorAnalysis() {} |
| 30 | 31 |
| 31 bool is_solid_color; | 32 bool is_solid_color; |
| 32 SkColor solid_color; | 33 SkColor solid_color; |
| 33 }; | 34 }; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 virtual void DidBeginTracing() = 0; | 96 virtual void DidBeginTracing() = 0; |
| 96 virtual void AsValueInto(base::trace_event::TracedValue* array) const = 0; | 97 virtual void AsValueInto(base::trace_event::TracedValue* array) const = 0; |
| 97 virtual skia::RefPtr<SkPicture> GetFlattenedPicture() = 0; | 98 virtual skia::RefPtr<SkPicture> GetFlattenedPicture() = 0; |
| 98 virtual size_t GetPictureMemoryUsage() const = 0; | 99 virtual size_t GetPictureMemoryUsage() const = 0; |
| 99 | 100 |
| 100 // Return true if LCD anti-aliasing may be used when rastering text. | 101 // Return true if LCD anti-aliasing may be used when rastering text. |
| 101 virtual bool CanUseLCDText() const = 0; | 102 virtual bool CanUseLCDText() const = 0; |
| 102 | 103 |
| 103 virtual scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const = 0; | 104 virtual scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const = 0; |
| 104 | 105 |
| 106 virtual void SetImageDecodeController( |
| 107 ImageDecodeController* image_decode_controller) = 0; |
| 108 |
| 105 protected: | 109 protected: |
| 106 friend class base::RefCountedThreadSafe<RasterSource>; | 110 friend class base::RefCountedThreadSafe<RasterSource>; |
| 107 | 111 |
| 108 RasterSource() {} | 112 RasterSource() {} |
| 109 virtual ~RasterSource() {} | 113 virtual ~RasterSource() {} |
| 110 | 114 |
| 111 private: | 115 private: |
| 112 DISALLOW_COPY_AND_ASSIGN(RasterSource); | 116 DISALLOW_COPY_AND_ASSIGN(RasterSource); |
| 113 }; | 117 }; |
| 114 | 118 |
| 115 } // namespace cc | 119 } // namespace cc |
| 116 | 120 |
| 117 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ | 121 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ |
| OLD | NEW |