| 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_COMMON_GPU_CLIENT_GL_HELPER_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ |
| 6 #define CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/atomicops.h" | 8 #include "base/atomicops.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "content/common/content_export.h" |
| 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
| 13 | 14 |
| 14 namespace gfx { | 15 namespace gfx { |
| 15 class Rect; | 16 class Rect; |
| 16 class Size; | 17 class Size; |
| 17 } | 18 } |
| 18 | 19 |
| 19 class SkRegion; | 20 class SkRegion; |
| 20 | 21 |
| 21 namespace content { | 22 namespace content { |
| 22 | 23 |
| 23 // Provides higher level operations on top of the WebKit::WebGraphicsContext3D | 24 // Provides higher level operations on top of the WebKit::WebGraphicsContext3D |
| 24 // interfaces. | 25 // interfaces. |
| 25 class GLHelper { | 26 class CONTENT_EXPORT GLHelper { |
| 26 public: | 27 public: |
| 27 GLHelper(WebKit::WebGraphicsContext3D* context, | 28 GLHelper(WebKit::WebGraphicsContext3D* context, |
| 28 WebKit::WebGraphicsContext3D* context_for_thread); | 29 WebKit::WebGraphicsContext3D* context_for_thread); |
| 29 virtual ~GLHelper(); | 30 virtual ~GLHelper(); |
| 30 | 31 |
| 31 WebKit::WebGraphicsContext3D* context() const; | 32 WebKit::WebGraphicsContext3D* context() const; |
| 32 | 33 |
| 33 // Copies the block of pixels specified with |src_subrect| from |src_texture|, | 34 // Copies the block of pixels specified with |src_subrect| from |src_texture|, |
| 34 // scales it to |dst_size|, and writes it into |out|. | 35 // scales it to |dst_size|, and writes it into |out|. |
| 35 // |src_size| is the size of |src_texture|. The result is of format GL_BGRA | 36 // |src_size| is the size of |src_texture|. The result is of format GL_BGRA |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 88 |
| 88 // The number of all GLHelper instances. | 89 // The number of all GLHelper instances. |
| 89 static base::subtle::Atomic32 count_; | 90 static base::subtle::Atomic32 count_; |
| 90 | 91 |
| 91 DISALLOW_COPY_AND_ASSIGN(GLHelper); | 92 DISALLOW_COPY_AND_ASSIGN(GLHelper); |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 } // namespace content | 95 } // namespace content |
| 95 | 96 |
| 96 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ | 97 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ |
| OLD | NEW |