OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "cc/resources/resource_provider.h" | 5 #include "cc/resources/resource_provider.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 if (can_use_lcd_text) { | 995 if (can_use_lcd_text) { |
996 // LegacyFontHost will get LCD text and skia figures out what type to use. | 996 // LegacyFontHost will get LCD text and skia figures out what type to use. |
997 surface_props = | 997 surface_props = |
998 SkSurfaceProps(flags, SkSurfaceProps::kLegacyFontHost_InitType); | 998 SkSurfaceProps(flags, SkSurfaceProps::kLegacyFontHost_InitType); |
999 } | 999 } |
1000 sk_surface_ = skia::AdoptRef( | 1000 sk_surface_ = skia::AdoptRef( |
1001 SkSurface::NewWrappedRenderTarget(gr_context, desc, &surface_props)); | 1001 SkSurface::NewWrappedRenderTarget(gr_context, desc, &surface_props)); |
1002 } | 1002 } |
1003 | 1003 |
1004 void ResourceProvider::ScopedWriteLockGr::ReleaseSkSurface() { | 1004 void ResourceProvider::ScopedWriteLockGr::ReleaseSkSurface() { |
| 1005 sk_surface_->getCanvas()->flush(); |
1005 sk_surface_.clear(); | 1006 sk_surface_.clear(); |
1006 } | 1007 } |
1007 | 1008 |
1008 ResourceProvider::SynchronousFence::SynchronousFence( | 1009 ResourceProvider::SynchronousFence::SynchronousFence( |
1009 gpu::gles2::GLES2Interface* gl) | 1010 gpu::gles2::GLES2Interface* gl) |
1010 : gl_(gl), has_synchronized_(true) { | 1011 : gl_(gl), has_synchronized_(true) { |
1011 } | 1012 } |
1012 | 1013 |
1013 ResourceProvider::SynchronousFence::~SynchronousFence() { | 1014 ResourceProvider::SynchronousFence::~SynchronousFence() { |
1014 } | 1015 } |
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1788 | 1789 |
1789 const int kImportance = 2; | 1790 const int kImportance = 2; |
1790 pmd->CreateSharedGlobalAllocatorDump(guid); | 1791 pmd->CreateSharedGlobalAllocatorDump(guid); |
1791 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 1792 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
1792 } | 1793 } |
1793 | 1794 |
1794 return true; | 1795 return true; |
1795 } | 1796 } |
1796 | 1797 |
1797 } // namespace cc | 1798 } // namespace cc |
OLD | NEW |