Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: cc/content_layer.h

Issue 11360093: Mark layers that can use LCD text based on layer transform and opacity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reverted whitespace change Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/content_layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_CONTENT_LAYER_H_ 5 #ifndef CC_CONTENT_LAYER_H_
6 #define CC_CONTENT_LAYER_H_ 6 #define CC_CONTENT_LAYER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "cc/cc_export.h" 9 #include "cc/cc_export.h"
10 #include "cc/layer_painter.h" 10 #include "cc/layer_painter.h"
(...skipping 19 matching lines...) Expand all
30 30
31 DISALLOW_COPY_AND_ASSIGN(ContentLayerPainter); 31 DISALLOW_COPY_AND_ASSIGN(ContentLayerPainter);
32 }; 32 };
33 33
34 // A layer that renders its contents into an SkCanvas. 34 // A layer that renders its contents into an SkCanvas.
35 class CC_EXPORT ContentLayer : public TiledLayer { 35 class CC_EXPORT ContentLayer : public TiledLayer {
36 public: 36 public:
37 static scoped_refptr<ContentLayer> create(ContentLayerClient*); 37 static scoped_refptr<ContentLayer> create(ContentLayerClient*);
38 38
39 void clearClient() { m_client = 0; } 39 void clearClient() { m_client = 0; }
40 bool useLCDText() const { return m_useLCDText; }
40 41
41 virtual bool drawsContent() const OVERRIDE; 42 virtual bool drawsContent() const OVERRIDE;
42 virtual void setTexturePriorities(const PriorityCalculator&) OVERRIDE; 43 virtual void setTexturePriorities(const PriorityCalculator&) OVERRIDE;
43 virtual void update(ResourceUpdateQueue&, const OcclusionTracker*, Rendering Stats&) OVERRIDE; 44 virtual void update(ResourceUpdateQueue&, const OcclusionTracker*, Rendering Stats&) OVERRIDE;
44 virtual bool needMoreUpdates() OVERRIDE; 45 virtual bool needMoreUpdates() OVERRIDE;
45 46
46 virtual void setContentsOpaque(bool) OVERRIDE; 47 virtual void setContentsOpaque(bool) OVERRIDE;
47 48
48 protected: 49 protected:
49 explicit ContentLayer(ContentLayerClient*); 50 explicit ContentLayer(ContentLayerClient*);
50 virtual ~ContentLayer(); 51 virtual ~ContentLayer();
51 52
52 private: 53 private:
53 virtual LayerUpdater* updater() const OVERRIDE; 54 virtual LayerUpdater* updater() const OVERRIDE;
54 virtual void createUpdaterIfNeeded() OVERRIDE; 55 virtual void createUpdaterIfNeeded() OVERRIDE;
55 56
57 void updateUseLCDText();
58 // Called when LCD text setting is about to potentially change.
59 // If this function returns true, the setting is allowed to change.
60 // If it returns false, the setting is not changed.
61 bool useLCDTextWillChange() const;
62 void useLCDTextDidChange();
63
56 ContentLayerClient* m_client; 64 ContentLayerClient* m_client;
57 scoped_refptr<LayerUpdater> m_updater; 65 scoped_refptr<LayerUpdater> m_updater;
66
67 bool m_useLCDText;
68 int m_lcdTextChangeCount;
69 static const int kLCDTextMaxChangeCount;
58 }; 70 };
59 71
60 } 72 }
61 #endif // CC_CONTENT_LAYER_H_ 73 #endif // CC_CONTENT_LAYER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/content_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698