OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 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. |
| 4 |
| 5 #include "cc/ganesh_resource_provider.h" |
| 6 |
| 7 #include "cc/resource.h" |
| 8 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
| 9 #include "third_party/skia/include/gpu/GrContext.h" |
| 10 #include "third_party/skia/include/gpu/GrTexture.h" |
| 11 |
| 12 namespace cc { |
| 13 |
| 14 GaneshResourceProvider::GaneshResourceProvider() |
| 15 : context3d_(NULL), |
| 16 gr_context_(NULL) { |
| 17 } |
| 18 |
| 19 GaneshResourceProvider::~GaneshResourceProvider() {} |
| 20 |
| 21 GaneshResourceProvider::ScopedContexts::ScopedContexts( |
| 22 GaneshResourceProvider* ganesh_resource_provider) |
| 23 : ganesh_resource_provider_(ganesh_resource_provider) { |
| 24 } |
| 25 |
| 26 GaneshResourceProvider::ScopedContexts::~ScopedContexts() {} |
| 27 |
| 28 GaneshResourceProvider::ScopedContextsFlushed::ScopedContextsFlushed( |
| 29 ResourceProvider* resource_provider, |
| 30 GaneshResourceProvider* ganesh_resource_provider) |
| 31 : ScopedContexts(ganesh_resource_provider) { |
| 32 resource_provider->flush(); |
| 33 } |
| 34 |
| 35 GaneshResourceProvider::ScopedContextsFlushed::~ScopedContextsFlushed() { |
| 36 // Flush ganesh context so that all the rendered stuff appears on the |
| 37 // texture. |
| 38 if (gr_context()) gr_context()->flush(); |
| 39 // Flush the GL context so rendering results from this context are |
| 40 // visible in the compositor's context. |
| 41 if (context3d()) context3d()->flush(); |
| 42 } |
| 43 |
| 44 } // namespace cc |
OLD | NEW |