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

Side by Side Diff: trunk/src/cc/resources/ui_resource_client.h

Issue 23740010: Revert 223162 "Update the nine patch layer to use UI resources" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
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_RESOURCES_UI_RESOURCE_CLIENT_H_ 5 #ifndef CC_RESOURCES_UI_RESOURCE_CLIENT_H_
6 #define CC_RESOURCES_UI_RESOURCE_CLIENT_H_ 6 #define CC_RESOURCES_UI_RESOURCE_CLIENT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "cc/base/cc_export.h" 11 #include "cc/base/cc_export.h"
12 12
13 namespace cc { 13 namespace cc {
14 14
15 class UIResourceBitmap; 15 class UIResourceBitmap;
16 16
17 typedef int UIResourceId; 17 typedef int UIResourceId;
18 18
19 class CC_EXPORT UIResourceClient { 19 class CC_EXPORT UIResourceClient {
20 public: 20 public:
21 // GetBitmap() will be called once soon after resource creation and then will 21 // GetBitmap() will be called once soon after resource creation and then will
22 // be called afterwards whenever the GL context is lost, on the same thread 22 // be called afterwards whenever the GL context is lost, on the same thread
23 // that LayerTreeHost::CreateUIResource was called on. It is only safe to 23 // that LayerTreeHost::CreateUIResource was called on. It is only safe to
24 // delete a UIResourceClient object after DeleteUIResource has been called for 24 // delete a UIResourceClient object after DeleteUIResource has been called for
25 // all IDs associated with it. A valid bitmap always must be returned but it 25 // all IDs associated with it. A valid bitmap always must be returned but it
26 // doesn't need to be the same size or format as the original. 26 // doesn't need to be the same size or format as the original.
27 virtual UIResourceBitmap GetBitmap(UIResourceId uid, 27 virtual scoped_refptr<UIResourceBitmap> GetBitmap(UIResourceId uid,
28 bool resource_lost) = 0; 28 bool resource_lost) = 0;
29 virtual ~UIResourceClient() {} 29 virtual ~UIResourceClient() {}
30 }; 30 };
31 31
32 } // namespace cc 32 } // namespace cc
33 33
34 #endif // CC_RESOURCES_UI_RESOURCE_CLIENT_H_ 34 #endif // CC_RESOURCES_UI_RESOURCE_CLIENT_H_
OLDNEW
« no previous file with comments | « trunk/src/cc/resources/ui_resource_bitmap.cc ('k') | trunk/src/cc/test/data/10_10_layer_tree.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698