| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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_LAYERS_CONTENT_LAYER_H_ | 5 #ifndef CC_LAYERS_CONTENT_LAYER_H_ |
| 6 #define CC_LAYERS_CONTENT_LAYER_H_ | 6 #define CC_LAYERS_CONTENT_LAYER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 10 #include "cc/layers/tiled_layer.h" | 10 #include "cc/layers/tiled_layer.h" |
| 11 #include "cc/resources/layer_painter.h" | 11 #include "cc/resources/layer_painter.h" |
| 12 | 12 |
| 13 class SkCanvas; | 13 class SkCanvas; |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 | 16 |
| 17 class ContentLayerClient; | 17 class ContentLayerClient; |
| 18 class ContentLayerUpdater; | 18 class ContentLayerUpdater; |
| 19 | 19 |
| 20 class CC_EXPORT ContentLayerPainter : public LayerPainter { | 20 class CC_EXPORT ContentLayerPainter : public LayerPainter { |
| 21 public: | 21 public: |
| 22 static scoped_ptr<ContentLayerPainter> Create(ContentLayerClient* client); | 22 static scoped_ptr<ContentLayerPainter> Create(ContentLayerClient* client); |
| 23 | 23 |
| 24 void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override; | 24 void Paint(SkCanvas* canvas, |
| 25 const gfx::Rect& content_rect, |
| 26 bool can_use_lcd_text, |
| 27 bool contents_opaque) override; |
| 25 | 28 |
| 26 private: | 29 private: |
| 27 explicit ContentLayerPainter(ContentLayerClient* client); | 30 explicit ContentLayerPainter(ContentLayerClient* client); |
| 28 | 31 |
| 29 ContentLayerClient* client_; | 32 ContentLayerClient* client_; |
| 30 | 33 |
| 31 DISALLOW_COPY_AND_ASSIGN(ContentLayerPainter); | 34 DISALLOW_COPY_AND_ASSIGN(ContentLayerPainter); |
| 32 }; | 35 }; |
| 33 | 36 |
| 34 // A layer that renders its contents into an SkCanvas. | 37 // A layer that renders its contents into an SkCanvas. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 63 | 66 |
| 64 private: | 67 private: |
| 65 // TiledLayer implementation. | 68 // TiledLayer implementation. |
| 66 void CreateUpdaterIfNeeded() override; | 69 void CreateUpdaterIfNeeded() override; |
| 67 | 70 |
| 68 void UpdateCanUseLCDText(); | 71 void UpdateCanUseLCDText(); |
| 69 | 72 |
| 70 ContentLayerClient* client_; | 73 ContentLayerClient* client_; |
| 71 scoped_refptr<ContentLayerUpdater> updater_; | 74 scoped_refptr<ContentLayerUpdater> updater_; |
| 72 bool can_use_lcd_text_last_frame_; | 75 bool can_use_lcd_text_last_frame_; |
| 76 bool first_update_lcd_text_occured_; |
| 73 | 77 |
| 74 DISALLOW_COPY_AND_ASSIGN(ContentLayer); | 78 DISALLOW_COPY_AND_ASSIGN(ContentLayer); |
| 75 }; | 79 }; |
| 76 | 80 |
| 77 } // namespace cc | 81 } // namespace cc |
| 78 #endif // CC_LAYERS_CONTENT_LAYER_H_ | 82 #endif // CC_LAYERS_CONTENT_LAYER_H_ |
| OLD | NEW |