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

Side by Side Diff: content/common/gpu/texture_image_transport_surface.h

Issue 10052018: Drop frontbuffers with ui-use-gpu-process, synchronized with browser, decoupled from backbuffer dro… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Major simplification! Created 8 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 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 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 CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ 5 #ifndef CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_
6 #define CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ 6 #define CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "content/common/gpu/gpu_command_buffer_stub.h" 10 #include "content/common/gpu/gpu_command_buffer_stub.h"
(...skipping 30 matching lines...) Expand all
41 virtual void* GetDisplay() OVERRIDE; 41 virtual void* GetDisplay() OVERRIDE;
42 virtual void* GetConfig() OVERRIDE; 42 virtual void* GetConfig() OVERRIDE;
43 43
44 protected: 44 protected:
45 // ImageTransportSurface implementation. 45 // ImageTransportSurface implementation.
46 virtual void OnNewSurfaceACK( 46 virtual void OnNewSurfaceACK(
47 uint64 surface_handle, TransportDIB::Handle shm_handle) OVERRIDE; 47 uint64 surface_handle, TransportDIB::Handle shm_handle) OVERRIDE;
48 virtual void OnBuffersSwappedACK() OVERRIDE; 48 virtual void OnBuffersSwappedACK() OVERRIDE;
49 virtual void OnPostSubBufferACK() OVERRIDE; 49 virtual void OnPostSubBufferACK() OVERRIDE;
50 virtual void OnResizeViewACK() OVERRIDE; 50 virtual void OnResizeViewACK() OVERRIDE;
51 virtual void OnSetFrontSurfaceIsProtected(bool is_protected) OVERRIDE;
51 virtual void OnResize(gfx::Size size) OVERRIDE; 52 virtual void OnResize(gfx::Size size) OVERRIDE;
52 53
53 // GpuCommandBufferStub::DestructionObserver implementation. 54 // GpuCommandBufferStub::DestructionObserver implementation.
54 virtual void OnWillDestroyStub(GpuCommandBufferStub* stub) OVERRIDE; 55 virtual void OnWillDestroyStub(GpuCommandBufferStub* stub) OVERRIDE;
55 56
56 private: 57 private:
57 // A texture backing the front/back buffer in the parent stub. 58 // A texture backing the front/back buffer in the parent stub.
58 struct Texture { 59 struct Texture {
59 Texture(); 60 Texture();
60 ~Texture(); 61 ~Texture();
61 62
62 // The client-side id in the parent stub. 63 // The client-side id in the parent stub.
63 uint32 client_id; 64 uint32 client_id;
64 65
65 // The currently allocated size. 66 // The currently allocated size.
66 gfx::Size size; 67 gfx::Size size;
67 68
68 // Whether or not that texture has been sent to the client yet. 69 // Whether or not that texture has been sent to the client yet.
69 bool sent_to_client; 70 bool sent_to_client;
70 71
71 // The texture info in the parent stub. 72 // The texture info in the parent stub.
72 gpu::gles2::TextureManager::TextureInfo::Ref info; 73 gpu::gles2::TextureManager::TextureInfo::Ref info;
73 }; 74 };
74 75
75 virtual ~TextureImageTransportSurface(); 76 virtual ~TextureImageTransportSurface();
76 void CreateBackTexture(const gfx::Size& size); 77 void CreateBackTexture(const gfx::Size& size);
77 void ReleaseBackTexture();
78 void AttachBackTextureToFBO(); 78 void AttachBackTextureToFBO();
79 void ReleaseTexture(int id);
79 void ReleaseParentStub(); 80 void ReleaseParentStub();
81 void AdjustFrontBufferAllocation();
82 int front() const { return front_; }
80 int back() const { return 1 - front_; } 83 int back() const { return 1 - front_; }
81 84
82 // The framebuffer that represents this surface (service id). Allocated lazily 85 // The framebuffer that represents this surface (service id). Allocated lazily
83 // in OnMakeCurrent. 86 // in OnMakeCurrent.
84 uint32 fbo_id_; 87 uint32 fbo_id_;
85 88
86 // The front and back buffers. 89 // The front and back buffers.
87 Texture textures_[2]; 90 Texture textures_[2];
88 91
89 gfx::Rect previous_damage_rect_; 92 gfx::Rect previous_damage_rect_;
90 93
91 // Indicates which of the 2 above is the front buffer. 94 // Indicates which of the 2 above is the front buffer.
92 int front_; 95 int front_;
93 96
94 // Whether or not the command buffer stub has been destroyed. 97 // Whether or not the command buffer stub has been destroyed.
95 bool stub_destroyed_; 98 bool stub_destroyed_;
96 99
97 bool backbuffer_suggested_allocation_; 100 bool backbuffer_suggested_allocation_;
98 bool frontbuffer_suggested_allocation_; 101 bool frontbuffer_suggested_allocation_;
99 102
103 bool frontbuffer_is_protected_;
104
100 scoped_ptr<ImageTransportHelper> helper_; 105 scoped_ptr<ImageTransportHelper> helper_;
101 gfx::GLSurfaceHandle handle_; 106 gfx::GLSurfaceHandle handle_;
102 GpuCommandBufferStub* parent_stub_; 107 GpuCommandBufferStub* parent_stub_;
103 108
104 DISALLOW_COPY_AND_ASSIGN(TextureImageTransportSurface); 109 DISALLOW_COPY_AND_ASSIGN(TextureImageTransportSurface);
105 }; 110 };
106 111
107 #endif // CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ 112 #endif // CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698