| 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_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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 // Resets the texture. | 94 // Resets the texture. |
| 95 void ClearTexture(); | 95 void ClearTexture(); |
| 96 | 96 |
| 97 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 97 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 98 | 98 |
| 99 // 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 |
| 100 // true. | 100 // true. |
| 101 void SetFlipped(bool flipped); | 101 void SetFlipped(bool flipped); |
| 102 | 102 |
| 103 // Sets whether this texture should use nearest neighbor interpolation as |
| 104 // opposed to bilinear. Defaults to false. |
| 105 void SetNearestNeighbor(bool nearest_neighbor); |
| 106 |
| 103 // Sets a UV transform to be used at draw time. Defaults to (0, 0) and (1, 1). | 107 // Sets a UV transform to be used at draw time. Defaults to (0, 0) and (1, 1). |
| 104 void SetUV(const gfx::PointF& top_left, const gfx::PointF& bottom_right); | 108 void SetUV(const gfx::PointF& top_left, const gfx::PointF& bottom_right); |
| 105 | 109 |
| 106 // Sets an opacity value per vertex. It will be multiplied by the layer | 110 // Sets an opacity value per vertex. It will be multiplied by the layer |
| 107 // opacity value. | 111 // opacity value. |
| 108 void SetVertexOpacity(float bottom_left, | 112 void SetVertexOpacity(float bottom_left, |
| 109 float top_left, | 113 float top_left, |
| 110 float top_right, | 114 float top_right, |
| 111 float bottom_right); | 115 float bottom_right); |
| 112 | 116 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 private: | 153 private: |
| 150 void SetTextureMailboxInternal( | 154 void SetTextureMailboxInternal( |
| 151 const TextureMailbox& mailbox, | 155 const TextureMailbox& mailbox, |
| 152 scoped_ptr<SingleReleaseCallback> release_callback, | 156 scoped_ptr<SingleReleaseCallback> release_callback, |
| 153 bool requires_commit, | 157 bool requires_commit, |
| 154 bool allow_mailbox_reuse); | 158 bool allow_mailbox_reuse); |
| 155 | 159 |
| 156 TextureLayerClient* client_; | 160 TextureLayerClient* client_; |
| 157 | 161 |
| 158 bool flipped_; | 162 bool flipped_; |
| 163 bool nearest_neighbor_; |
| 159 gfx::PointF uv_top_left_; | 164 gfx::PointF uv_top_left_; |
| 160 gfx::PointF uv_bottom_right_; | 165 gfx::PointF uv_bottom_right_; |
| 161 // [bottom left, top left, top right, bottom right] | 166 // [bottom left, top left, top right, bottom right] |
| 162 float vertex_opacity_[4]; | 167 float vertex_opacity_[4]; |
| 163 bool premultiplied_alpha_; | 168 bool premultiplied_alpha_; |
| 164 bool blend_background_color_; | 169 bool blend_background_color_; |
| 165 bool rate_limit_context_; | 170 bool rate_limit_context_; |
| 166 | 171 |
| 167 scoped_ptr<TextureMailboxHolder::MainThreadReference> holder_ref_; | 172 scoped_ptr<TextureMailboxHolder::MainThreadReference> holder_ref_; |
| 168 bool needs_set_mailbox_; | 173 bool needs_set_mailbox_; |
| 169 | 174 |
| 170 DISALLOW_COPY_AND_ASSIGN(TextureLayer); | 175 DISALLOW_COPY_AND_ASSIGN(TextureLayer); |
| 171 }; | 176 }; |
| 172 | 177 |
| 173 } // namespace cc | 178 } // namespace cc |
| 174 #endif // CC_LAYERS_TEXTURE_LAYER_H_ | 179 #endif // CC_LAYERS_TEXTURE_LAYER_H_ |
| OLD | NEW |