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

Side by Side Diff: cc/layers/texture_layer.h

Issue 645853008: Standardize usage of virtual/override/final in cc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatted Created 6 years, 2 months 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
« no previous file with comments | « cc/layers/surface_layer_impl.h ('k') | cc/layers/texture_layer_impl.h » ('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_LAYERS_TEXTURE_LAYER_H_ 5 #ifndef CC_LAYERS_TEXTURE_LAYER_H_
6 #define CC_LAYERS_TEXTURE_LAYER_H_ 6 #define CC_LAYERS_TEXTURE_LAYER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // Used when mailbox names are specified instead of texture IDs. 87 // Used when mailbox names are specified instead of texture IDs.
88 static scoped_refptr<TextureLayer> CreateForMailbox( 88 static scoped_refptr<TextureLayer> CreateForMailbox(
89 TextureLayerClient* client); 89 TextureLayerClient* client);
90 90
91 // Resets the client, which also resets the texture. 91 // Resets the client, which also resets the texture.
92 void ClearClient(); 92 void ClearClient();
93 93
94 // Resets the texture. 94 // Resets the texture.
95 void ClearTexture(); 95 void ClearTexture();
96 96
97 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) 97 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
98 override;
99 98
100 // Sets whether this texture should be Y-flipped at draw time. Defaults to 99 // Sets whether this texture should be Y-flipped at draw time. Defaults to
101 // true. 100 // true.
102 void SetFlipped(bool flipped); 101 void SetFlipped(bool flipped);
103 102
104 // Sets a UV transform to be used at draw time. Defaults to (0, 0) and (1, 1). 103 // Sets a UV transform to be used at draw time. Defaults to (0, 0) and (1, 1).
105 void SetUV(const gfx::PointF& top_left, const gfx::PointF& bottom_right); 104 void SetUV(const gfx::PointF& top_left, const gfx::PointF& bottom_right);
106 105
107 // Sets an opacity value per vertex. It will be multiplied by the layer 106 // Sets an opacity value per vertex. It will be multiplied by the layer
108 // opacity value. 107 // opacity value.
(...skipping 18 matching lines...) Expand all
127 // Code path for plugins which supply their own mailbox. 126 // Code path for plugins which supply their own mailbox.
128 void SetTextureMailbox(const TextureMailbox& mailbox, 127 void SetTextureMailbox(const TextureMailbox& mailbox,
129 scoped_ptr<SingleReleaseCallback> release_callback); 128 scoped_ptr<SingleReleaseCallback> release_callback);
130 129
131 // Use this for special cases where the same texture is used to back the 130 // Use this for special cases where the same texture is used to back the
132 // TextureLayer across all frames. 131 // TextureLayer across all frames.
133 // WARNING: DON'T ACTUALLY USE THIS WHAT YOU ARE DOING IS WRONG. 132 // WARNING: DON'T ACTUALLY USE THIS WHAT YOU ARE DOING IS WRONG.
134 // TODO(danakj): Remove this when pepper doesn't need it. crbug.com/350204 133 // TODO(danakj): Remove this when pepper doesn't need it. crbug.com/350204
135 void SetTextureMailboxWithoutReleaseCallback(const TextureMailbox& mailbox); 134 void SetTextureMailboxWithoutReleaseCallback(const TextureMailbox& mailbox);
136 135
137 virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect) override; 136 void SetNeedsDisplayRect(const gfx::Rect& dirty_rect) override;
138 137
139 virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override; 138 void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override;
140 virtual bool Update(ResourceUpdateQueue* queue, 139 bool Update(ResourceUpdateQueue* queue,
141 const OcclusionTracker<Layer>* occlusion) override; 140 const OcclusionTracker<Layer>* occlusion) override;
142 virtual void PushPropertiesTo(LayerImpl* layer) override; 141 void PushPropertiesTo(LayerImpl* layer) override;
143 virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const override; 142 SimpleEnclosedRegion VisibleContentOpaqueRegion() const override;
144 143
145 protected: 144 protected:
146 explicit TextureLayer(TextureLayerClient* client); 145 explicit TextureLayer(TextureLayerClient* client);
147 virtual ~TextureLayer(); 146 ~TextureLayer() override;
148 virtual bool HasDrawableContent() const override; 147 bool HasDrawableContent() const override;
149 148
150 private: 149 private:
151 void SetTextureMailboxInternal( 150 void SetTextureMailboxInternal(
152 const TextureMailbox& mailbox, 151 const TextureMailbox& mailbox,
153 scoped_ptr<SingleReleaseCallback> release_callback, 152 scoped_ptr<SingleReleaseCallback> release_callback,
154 bool requires_commit, 153 bool requires_commit,
155 bool allow_mailbox_reuse); 154 bool allow_mailbox_reuse);
156 155
157 TextureLayerClient* client_; 156 TextureLayerClient* client_;
158 157
159 bool flipped_; 158 bool flipped_;
160 gfx::PointF uv_top_left_; 159 gfx::PointF uv_top_left_;
161 gfx::PointF uv_bottom_right_; 160 gfx::PointF uv_bottom_right_;
162 // [bottom left, top left, top right, bottom right] 161 // [bottom left, top left, top right, bottom right]
163 float vertex_opacity_[4]; 162 float vertex_opacity_[4];
164 bool premultiplied_alpha_; 163 bool premultiplied_alpha_;
165 bool blend_background_color_; 164 bool blend_background_color_;
166 bool rate_limit_context_; 165 bool rate_limit_context_;
167 166
168 scoped_ptr<TextureMailboxHolder::MainThreadReference> holder_ref_; 167 scoped_ptr<TextureMailboxHolder::MainThreadReference> holder_ref_;
169 bool needs_set_mailbox_; 168 bool needs_set_mailbox_;
170 169
171 DISALLOW_COPY_AND_ASSIGN(TextureLayer); 170 DISALLOW_COPY_AND_ASSIGN(TextureLayer);
172 }; 171 };
173 172
174 } // namespace cc 173 } // namespace cc
175 #endif // CC_LAYERS_TEXTURE_LAYER_H_ 174 #endif // CC_LAYERS_TEXTURE_LAYER_H_
OLDNEW
« no previous file with comments | « cc/layers/surface_layer_impl.h ('k') | cc/layers/texture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698