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

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

Issue 664173002: Prevent recreation of UI resource holder when created with resource ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added NeedsCreation 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 | « no previous file | cc/layers/ui_resource_layer.cc » ('j') | cc/layers/ui_resource_layer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_UI_RESOURCE_LAYER_H_ 5 #ifndef CC_LAYERS_UI_RESOURCE_LAYER_H_
6 #define CC_LAYERS_UI_RESOURCE_LAYER_H_ 6 #define CC_LAYERS_UI_RESOURCE_LAYER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/base/cc_export.h" 9 #include "cc/base/cc_export.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
(...skipping 25 matching lines...) Expand all
36 // opacity value. 36 // opacity value.
37 void SetVertexOpacity(float bottom_left, 37 void SetVertexOpacity(float bottom_left,
38 float top_left, 38 float top_left,
39 float top_right, 39 float top_right,
40 float bottom_right); 40 float bottom_right);
41 41
42 class UIResourceHolder { 42 class UIResourceHolder {
43 public: 43 public:
44 virtual UIResourceId id() = 0; 44 virtual UIResourceId id() = 0;
45 virtual ~UIResourceHolder(); 45 virtual ~UIResourceHolder();
46 virtual bool NeedsRecreation();
46 }; 47 };
47 48
48 protected: 49 protected:
49 UIResourceLayer(); 50 UIResourceLayer();
50 ~UIResourceLayer() override; 51 ~UIResourceLayer() override;
51 52
52 bool HasDrawableContent() const override; 53 bool HasDrawableContent() const override;
53 54
54 scoped_ptr<UIResourceHolder> ui_resource_holder_; 55 scoped_ptr<UIResourceHolder> ui_resource_holder_;
55 SkBitmap bitmap_; 56 SkBitmap bitmap_;
56 57
57 gfx::PointF uv_top_left_; 58 gfx::PointF uv_top_left_;
58 gfx::PointF uv_bottom_right_; 59 gfx::PointF uv_bottom_right_;
59 float vertex_opacity_[4]; 60 float vertex_opacity_[4];
60 61
61 private: 62 private:
62 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; 63 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
63 void RecreateUIResourceHolder(); 64 void RecreateUIResourceHolder();
64 65
65 66
66 67
67 DISALLOW_COPY_AND_ASSIGN(UIResourceLayer); 68 DISALLOW_COPY_AND_ASSIGN(UIResourceLayer);
68 }; 69 };
69 70
70 } // namespace cc 71 } // namespace cc
71 72
72 #endif // CC_LAYERS_UI_RESOURCE_LAYER_H_ 73 #endif // CC_LAYERS_UI_RESOURCE_LAYER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/layers/ui_resource_layer.cc » ('j') | cc/layers/ui_resource_layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698