Revert of Roll Clang 218707:220284 (+cherry-picks of 220340, 220403 and 220407) ...
[chromium-blink-merge.git] / content / common / gpu / null_transport_surface.h
blob53f86fcc06e2c1345d4f7aec56eed31141865406
1 // Copyright (c) 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.
5 #ifndef CONTENT_COMMON_GPU_NULL_TRANSPORT_SURFACE_H_
6 #define CONTENT_COMMON_GPU_NULL_TRANSPORT_SURFACE_H_
8 #include "base/basictypes.h"
9 #include "content/common/gpu/image_transport_surface.h"
10 #include "ui/gfx/native_widget_types.h"
12 namespace content {
14 // Used when the GPU process is not involved in frame transport, but frame
15 // resources are exchanged between client and target directly (such as in
16 // delegated rendering).
17 class NullTransportSurface : public PassThroughImageTransportSurface {
18 public:
19 NullTransportSurface(GpuChannelManager* manager,
20 GpuCommandBufferStub* stub,
21 const gfx::GLSurfaceHandle& handle);
23 // gfx::GLSurfaceAdapter implementation.
24 bool Initialize() override;
25 void Destroy() override;
26 bool SwapBuffers() override;
27 bool PostSubBuffer(int x, int y, int width, int height) override;
28 bool OnMakeCurrent(gfx::GLContext* context) override;
30 protected:
31 ~NullTransportSurface() override;
33 void SendVSyncUpdateIfAvailable() override;
35 private:
36 uint32 parent_client_id_;
38 DISALLOW_COPY_AND_ASSIGN(NullTransportSurface);
41 } // namespace content
43 #endif // CONTENT_COMMON_GPU_NULL_TRANSPORT_SURFACE_H_