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

Side by Side Diff: sky/viewer/cc/web_external_texture_layer_impl.h

Issue 752683002: Break Sky's dependency on cc (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SKY_VIEWER_CC_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_
6 #define SKY_VIEWER_CC_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_
7
8 #include "base/bind.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/scoped_vector.h"
11 #include "sky/viewer/cc/sky_viewer_cc_export.h"
12 #include "cc/layers/texture_layer_client.h"
13 #include "sky/engine/public/platform/WebExternalTextureLayer.h"
14
15 namespace blink {
16 struct WebFloatRect;
17 struct WebExternalTextureMailbox;
18 }
19
20 namespace cc {
21 class SingleReleaseCallback;
22 class TextureMailbox;
23 }
24
25 namespace sky_viewer_cc {
26
27 class WebLayerImpl;
28 class WebExternalBitmapImpl;
29
30 class WebExternalTextureLayerImpl
31 : public blink::WebExternalTextureLayer,
32 public cc::TextureLayerClient,
33 public base::SupportsWeakPtr<WebExternalTextureLayerImpl> {
34 public:
35 SKY_VIEWER_CC_EXPORT explicit WebExternalTextureLayerImpl(
36 blink::WebExternalTextureLayerClient*);
37 virtual ~WebExternalTextureLayerImpl();
38
39 // blink::WebExternalTextureLayer implementation.
40 virtual blink::WebLayer* layer();
41 virtual void clearTexture();
42 virtual void setOpaque(bool opaque);
43 virtual void setPremultipliedAlpha(bool premultiplied);
44 virtual void setBlendBackgroundColor(bool blend);
45 virtual void setRateLimitContext(bool rate_limit);
46
47 // TextureLayerClient implementation.
48 virtual bool PrepareTextureMailbox(
49 cc::TextureMailbox* mailbox,
50 scoped_ptr<cc::SingleReleaseCallback>* release_callback,
51 bool use_shared_memory) override;
52
53 private:
54 static void DidReleaseMailbox(
55 base::WeakPtr<WebExternalTextureLayerImpl> layer,
56 const blink::WebExternalTextureMailbox& mailbox,
57 WebExternalBitmapImpl* bitmap,
58 unsigned sync_point,
59 bool lost_resource);
60
61 WebExternalBitmapImpl* AllocateBitmap();
62
63 blink::WebExternalTextureLayerClient* client_;
64 scoped_ptr<WebLayerImpl> layer_;
65 ScopedVector<WebExternalBitmapImpl> free_bitmaps_;
66
67 DISALLOW_COPY_AND_ASSIGN(WebExternalTextureLayerImpl);
68 };
69
70 } // namespace sky_viewer_cc
71
72 #endif // SKY_VIEWER_CC_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « sky/viewer/cc/web_external_bitmap_impl.cc ('k') | sky/viewer/cc/web_external_texture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698