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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 resource_provider_->GrContext(use_worker_context); | 1132 resource_provider_->GrContext(use_worker_context); |
1133 uint32_t flags = | 1133 uint32_t flags = |
1134 use_distance_field_text ? SkSurfaceProps::kUseDistanceFieldFonts_Flag : 0; | 1134 use_distance_field_text ? SkSurfaceProps::kUseDistanceFieldFonts_Flag : 0; |
1135 // Use unknown pixel geometry to disable LCD text. | 1135 // Use unknown pixel geometry to disable LCD text. |
1136 SkSurfaceProps surface_props(flags, kUnknown_SkPixelGeometry); | 1136 SkSurfaceProps surface_props(flags, kUnknown_SkPixelGeometry); |
1137 if (can_use_lcd_text) { | 1137 if (can_use_lcd_text) { |
1138 // LegacyFontHost will get LCD text and skia figures out what type to use. | 1138 // LegacyFontHost will get LCD text and skia figures out what type to use. |
1139 surface_props = | 1139 surface_props = |
1140 SkSurfaceProps(flags, SkSurfaceProps::kLegacyFontHost_InitType); | 1140 SkSurfaceProps(flags, SkSurfaceProps::kLegacyFontHost_InitType); |
1141 } | 1141 } |
1142 sk_surface_ = skia::AdoptRef(SkSurface::NewFromBackendTextureAsRenderTarget( | 1142 sk_surface_ = SkSurface::MakeFromBackendTextureAsRenderTarget( |
1143 gr_context, desc, &surface_props)); | 1143 gr_context, desc, &surface_props); |
1144 } | 1144 } |
1145 | 1145 |
1146 void ResourceProvider::ScopedWriteLockGr::ReleaseSkSurface() { | 1146 void ResourceProvider::ScopedWriteLockGr::ReleaseSkSurface() { |
1147 DCHECK(sk_surface_); | 1147 DCHECK(sk_surface_); |
1148 sk_surface_->prepareForExternalIO(); | 1148 sk_surface_->prepareForExternalIO(); |
1149 sk_surface_.clear(); | 1149 sk_surface_.reset(); |
1150 } | 1150 } |
1151 | 1151 |
1152 ResourceProvider::SynchronousFence::SynchronousFence( | 1152 ResourceProvider::SynchronousFence::SynchronousFence( |
1153 gpu::gles2::GLES2Interface* gl) | 1153 gpu::gles2::GLES2Interface* gl) |
1154 : gl_(gl), has_synchronized_(true) { | 1154 : gl_(gl), has_synchronized_(true) { |
1155 } | 1155 } |
1156 | 1156 |
1157 ResourceProvider::SynchronousFence::~SynchronousFence() { | 1157 ResourceProvider::SynchronousFence::~SynchronousFence() { |
1158 } | 1158 } |
1159 | 1159 |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1960 | 1960 |
1961 const int kImportance = 2; | 1961 const int kImportance = 2; |
1962 pmd->CreateSharedGlobalAllocatorDump(guid); | 1962 pmd->CreateSharedGlobalAllocatorDump(guid); |
1963 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 1963 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
1964 } | 1964 } |
1965 | 1965 |
1966 return true; | 1966 return true; |
1967 } | 1967 } |
1968 | 1968 |
1969 } // namespace cc | 1969 } // namespace cc |
OLD | NEW |