Disable ContentSettingBubbleModelTest.RPHAllow which is flaky.
[chromium-blink-merge.git] / content / renderer / pepper / pepper_platform_image_2d_impl.h
blob099a4281079dd475d605a14e23238ef8ae3ffcc2
1 // Copyright (c) 2012 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.
5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_IMAGE_2D_IMPL_H_
6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_IMAGE_2D_IMPL_H_
8 #include "base/basictypes.h"
9 #include "webkit/plugins/ppapi/plugin_delegate.h"
11 namespace content {
13 // Implements the Image2D using a TransportDIB.
14 class PepperPlatformImage2DImpl
15 : public webkit::ppapi::PluginDelegate::PlatformImage2D {
16 public:
17 virtual ~PepperPlatformImage2DImpl();
19 // Factory function that properly allocates a TransportDIB according to
20 // the platform. Returns NULL on failure.
21 static PepperPlatformImage2DImpl* Create(int width, int height);
23 // PlatformImage2D implementation.
24 virtual SkCanvas* Map() OVERRIDE;
25 virtual intptr_t GetSharedMemoryHandle(uint32* byte_count) const OVERRIDE;
26 virtual TransportDIB* GetTransportDIB() const OVERRIDE;
28 private:
29 // This constructor will take ownership of the dib pointer.
30 // On Mac, we assume that the dib is cached by the browser, so on destruction
31 // we'll tell the browser to free it.
32 PepperPlatformImage2DImpl(int width, int height, TransportDIB* dib);
34 int width_;
35 int height_;
36 scoped_ptr<TransportDIB> dib_;
38 DISALLOW_COPY_AND_ASSIGN(PepperPlatformImage2DImpl);
41 } // namespace content
43 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_IMAGE_2D_IMPL_H_