Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(517)

Side by Side Diff: cc/resources/resource_provider.cc

Issue 1063493002: cc: Remove all traces of synchronous GPU rasterization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/resources/resource_provider.h ('k') | cc/resources/software_rasterizer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 resource_provider_->LazyAllocate(resource_); 1124 resource_provider_->LazyAllocate(resource_);
1125 } 1125 }
1126 1126
1127 ResourceProvider::ScopedWriteLockGr::~ScopedWriteLockGr() { 1127 ResourceProvider::ScopedWriteLockGr::~ScopedWriteLockGr() {
1128 DCHECK(thread_checker_.CalledOnValidThread()); 1128 DCHECK(thread_checker_.CalledOnValidThread());
1129 DCHECK(resource_->locked_for_write); 1129 DCHECK(resource_->locked_for_write);
1130 resource_provider_->UnlockForWrite(resource_); 1130 resource_provider_->UnlockForWrite(resource_);
1131 } 1131 }
1132 1132
1133 void ResourceProvider::ScopedWriteLockGr::InitSkSurface( 1133 void ResourceProvider::ScopedWriteLockGr::InitSkSurface(
1134 bool use_worker_context,
1135 bool use_distance_field_text, 1134 bool use_distance_field_text,
1136 bool can_use_lcd_text, 1135 bool can_use_lcd_text,
1137 int msaa_sample_count) { 1136 int msaa_sample_count) {
1138 DCHECK(resource_->locked_for_write); 1137 DCHECK(resource_->locked_for_write);
1139 1138
1140 GrBackendTextureDesc desc; 1139 GrBackendTextureDesc desc;
1141 desc.fFlags = kRenderTarget_GrBackendTextureFlag; 1140 desc.fFlags = kRenderTarget_GrBackendTextureFlag;
1142 desc.fWidth = resource_->size.width(); 1141 desc.fWidth = resource_->size.width();
1143 desc.fHeight = resource_->size.height(); 1142 desc.fHeight = resource_->size.height();
1144 desc.fConfig = ToGrPixelConfig(resource_->format); 1143 desc.fConfig = ToGrPixelConfig(resource_->format);
1145 desc.fOrigin = kTopLeft_GrSurfaceOrigin; 1144 desc.fOrigin = kTopLeft_GrSurfaceOrigin;
1146 desc.fTextureHandle = resource_->gl_id; 1145 desc.fTextureHandle = resource_->gl_id;
1147 desc.fSampleCnt = msaa_sample_count; 1146 desc.fSampleCnt = msaa_sample_count;
1148 1147
1148 bool use_worker_context = true;
1149 class GrContext* gr_context = 1149 class GrContext* gr_context =
1150 resource_provider_->GrContext(use_worker_context); 1150 resource_provider_->GrContext(use_worker_context);
1151 skia::RefPtr<GrTexture> gr_texture = 1151 skia::RefPtr<GrTexture> gr_texture =
1152 skia::AdoptRef(gr_context->wrapBackendTexture(desc)); 1152 skia::AdoptRef(gr_context->wrapBackendTexture(desc));
1153 if (gr_texture) { 1153 if (gr_texture) {
1154 uint32_t flags = use_distance_field_text 1154 uint32_t flags = use_distance_field_text
1155 ? SkSurfaceProps::kUseDistanceFieldFonts_Flag 1155 ? SkSurfaceProps::kUseDistanceFieldFonts_Flag
1156 : 0; 1156 : 0;
1157 // Use unknown pixel geometry to disable LCD text. 1157 // Use unknown pixel geometry to disable LCD text.
1158 SkSurfaceProps surface_props(flags, kUnknown_SkPixelGeometry); 1158 SkSurfaceProps surface_props(flags, kUnknown_SkPixelGeometry);
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
2165 } 2165 }
2166 2166
2167 class GrContext* ResourceProvider::GrContext(bool worker_context) const { 2167 class GrContext* ResourceProvider::GrContext(bool worker_context) const {
2168 ContextProvider* context_provider = 2168 ContextProvider* context_provider =
2169 worker_context ? output_surface_->worker_context_provider() 2169 worker_context ? output_surface_->worker_context_provider()
2170 : output_surface_->context_provider(); 2170 : output_surface_->context_provider();
2171 return context_provider ? context_provider->GrContext() : NULL; 2171 return context_provider ? context_provider->GrContext() : NULL;
2172 } 2172 }
2173 2173
2174 } // namespace cc 2174 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_provider.h ('k') | cc/resources/software_rasterizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698