| OLD | NEW |
| 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_BROWSER_COMPOSITOR_GL_HELPER_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_GL_HELPER_H_ |
| 6 #define CONTENT_BROWSER_COMPOSITOR_GL_HELPER_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_GL_HELPER_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/atomicops.h" | 10 #include "base/atomicops.h" |
| 9 #include "base/callback.h" | 11 #include "base/callback.h" |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 13 #include "gpu/command_buffer/client/gles2_interface.h" | 14 #include "gpu/command_buffer/client/gles2_interface.h" |
| 14 #include "gpu/command_buffer/common/mailbox_holder.h" | 15 #include "gpu/command_buffer/common/mailbox_holder.h" |
| 15 #include "third_party/skia/include/core/SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
| 16 | 17 |
| 17 namespace gfx { | 18 namespace gfx { |
| 18 class Point; | 19 class Point; |
| 19 class Rect; | 20 class Rect; |
| 20 class Size; | 21 class Size; |
| 21 } | 22 } |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 336 |
| 336 // Creates |copy_texture_to_impl_| if NULL. | 337 // Creates |copy_texture_to_impl_| if NULL. |
| 337 void InitCopyTextToImpl(); | 338 void InitCopyTextToImpl(); |
| 338 // Creates |scaler_impl_| if NULL. | 339 // Creates |scaler_impl_| if NULL. |
| 339 void InitScalerImpl(); | 340 void InitScalerImpl(); |
| 340 | 341 |
| 341 enum ReadbackSwizzle { kSwizzleNone = 0, kSwizzleBGRA }; | 342 enum ReadbackSwizzle { kSwizzleNone = 0, kSwizzleBGRA }; |
| 342 | 343 |
| 343 gpu::gles2::GLES2Interface* gl_; | 344 gpu::gles2::GLES2Interface* gl_; |
| 344 gpu::ContextSupport* context_support_; | 345 gpu::ContextSupport* context_support_; |
| 345 scoped_ptr<CopyTextureToImpl> copy_texture_to_impl_; | 346 std::unique_ptr<CopyTextureToImpl> copy_texture_to_impl_; |
| 346 scoped_ptr<GLHelperScaling> scaler_impl_; | 347 std::unique_ptr<GLHelperScaling> scaler_impl_; |
| 347 scoped_ptr<GLHelperReadbackSupport> readback_support_; | 348 std::unique_ptr<GLHelperReadbackSupport> readback_support_; |
| 348 | 349 |
| 349 DISALLOW_COPY_AND_ASSIGN(GLHelper); | 350 DISALLOW_COPY_AND_ASSIGN(GLHelper); |
| 350 }; | 351 }; |
| 351 | 352 |
| 352 // Similar to a ScalerInterface, a yuv readback pipeline will | 353 // Similar to a ScalerInterface, a yuv readback pipeline will |
| 353 // cache a scaler and all intermediate textures and frame buffers | 354 // cache a scaler and all intermediate textures and frame buffers |
| 354 // needed to scale, crop, letterbox and read back a texture from | 355 // needed to scale, crop, letterbox and read back a texture from |
| 355 // the GPU into CPU-accessible RAM. A single readback pipeline | 356 // the GPU into CPU-accessible RAM. A single readback pipeline |
| 356 // can handle multiple outstanding readbacks at the same time, but | 357 // can handle multiple outstanding readbacks at the same time, but |
| 357 // if the source or destination sizes change, you'll need to create | 358 // if the source or destination sizes change, you'll need to create |
| (...skipping 12 matching lines...) Expand all Loading... |
| 370 const gpu::SyncToken& sync_token, | 371 const gpu::SyncToken& sync_token, |
| 371 const scoped_refptr<media::VideoFrame>& target, | 372 const scoped_refptr<media::VideoFrame>& target, |
| 372 const gfx::Point& paste_location, | 373 const gfx::Point& paste_location, |
| 373 const base::Callback<void(bool)>& callback) = 0; | 374 const base::Callback<void(bool)>& callback) = 0; |
| 374 virtual GLHelper::ScalerInterface* scaler() = 0; | 375 virtual GLHelper::ScalerInterface* scaler() = 0; |
| 375 }; | 376 }; |
| 376 | 377 |
| 377 } // namespace content | 378 } // namespace content |
| 378 | 379 |
| 379 #endif // CONTENT_BROWSER_COMPOSITOR_GL_HELPER_H_ | 380 #endif // CONTENT_BROWSER_COMPOSITOR_GL_HELPER_H_ |
| OLD | NEW |