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

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

Issue 558083002: [cc] Add nearest neighbor filtering for TextureLayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase Created 6 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
« no previous file with comments | « cc/layers/texture_layer.cc ('k') | cc/layers/texture_layer_impl.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_IMPL_H_ 5 #ifndef CC_LAYERS_TEXTURE_LAYER_IMPL_H_
6 #define CC_LAYERS_TEXTURE_LAYER_IMPL_H_ 6 #define CC_LAYERS_TEXTURE_LAYER_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 23 matching lines...) Expand all
34 SimpleEnclosedRegion VisibleContentOpaqueRegion() const override; 34 SimpleEnclosedRegion VisibleContentOpaqueRegion() const override;
35 void ReleaseResources() override; 35 void ReleaseResources() override;
36 36
37 // These setter methods don't cause any implicit damage, so the texture client 37 // These setter methods don't cause any implicit damage, so the texture client
38 // must explicitly invalidate if they intend to cause a visible change in the 38 // must explicitly invalidate if they intend to cause a visible change in the
39 // layer's output. 39 // layer's output.
40 void SetTextureId(unsigned id); 40 void SetTextureId(unsigned id);
41 void SetPremultipliedAlpha(bool premultiplied_alpha); 41 void SetPremultipliedAlpha(bool premultiplied_alpha);
42 void SetBlendBackgroundColor(bool blend); 42 void SetBlendBackgroundColor(bool blend);
43 void SetFlipped(bool flipped); 43 void SetFlipped(bool flipped);
44 void SetNearestNeighbor(bool nearest_neighbor);
44 void SetUVTopLeft(const gfx::PointF top_left); 45 void SetUVTopLeft(const gfx::PointF top_left);
45 void SetUVBottomRight(const gfx::PointF bottom_right); 46 void SetUVBottomRight(const gfx::PointF bottom_right);
46 47
47 // 1--2 48 // 1--2
48 // | | 49 // | |
49 // 0--3 50 // 0--3
50 void SetVertexOpacity(const float vertex_opacity[4]); 51 void SetVertexOpacity(const float vertex_opacity[4]);
51 52
52 void SetTextureMailbox( 53 void SetTextureMailbox(
53 const TextureMailbox& mailbox, 54 const TextureMailbox& mailbox,
54 scoped_ptr<SingleReleaseCallbackImpl> release_callback); 55 scoped_ptr<SingleReleaseCallbackImpl> release_callback);
55 56
56 private: 57 private:
57 TextureLayerImpl(LayerTreeImpl* tree_impl, int id); 58 TextureLayerImpl(LayerTreeImpl* tree_impl, int id);
58 59
59 const char* LayerTypeAsString() const override; 60 const char* LayerTypeAsString() const override;
60 void FreeTextureMailbox(); 61 void FreeTextureMailbox();
61 62
62 ResourceProvider::ResourceId external_texture_resource_; 63 ResourceProvider::ResourceId external_texture_resource_;
63 bool premultiplied_alpha_; 64 bool premultiplied_alpha_;
64 bool blend_background_color_; 65 bool blend_background_color_;
65 bool flipped_; 66 bool flipped_;
67 bool nearest_neighbor_;
66 gfx::PointF uv_top_left_; 68 gfx::PointF uv_top_left_;
67 gfx::PointF uv_bottom_right_; 69 gfx::PointF uv_bottom_right_;
68 float vertex_opacity_[4]; 70 float vertex_opacity_[4];
69 // This is a resource that's a GL copy of a software texture mailbox. 71 // This is a resource that's a GL copy of a software texture mailbox.
70 scoped_ptr<ScopedResource> texture_copy_; 72 scoped_ptr<ScopedResource> texture_copy_;
71 73
72 TextureMailbox texture_mailbox_; 74 TextureMailbox texture_mailbox_;
73 scoped_ptr<SingleReleaseCallbackImpl> release_callback_; 75 scoped_ptr<SingleReleaseCallbackImpl> release_callback_;
74 bool own_mailbox_; 76 bool own_mailbox_;
75 bool valid_texture_copy_; 77 bool valid_texture_copy_;
76 78
77 DISALLOW_COPY_AND_ASSIGN(TextureLayerImpl); 79 DISALLOW_COPY_AND_ASSIGN(TextureLayerImpl);
78 }; 80 };
79 81
80 } // namespace cc 82 } // namespace cc
81 83
82 #endif // CC_LAYERS_TEXTURE_LAYER_IMPL_H_ 84 #endif // CC_LAYERS_TEXTURE_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/texture_layer.cc ('k') | cc/layers/texture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698