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

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

Issue 267073003: Make --enable-delegated-renderer show stuff on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix null checks" Created 6 years, 7 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
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 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after
1605 TransferableResource* resource) { 1605 TransferableResource* resource) {
1606 Resource* source = GetResource(id); 1606 Resource* source = GetResource(id);
1607 DCHECK(!source->locked_for_write); 1607 DCHECK(!source->locked_for_write);
1608 DCHECK(!source->lock_for_read_count); 1608 DCHECK(!source->lock_for_read_count);
1609 // Because CreateResourceFromExternalTexture() never be called, 1609 // Because CreateResourceFromExternalTexture() never be called,
1610 // when enabling delegated compositor. 1610 // when enabling delegated compositor.
1611 DCHECK(source->origin == Resource::Internal || 1611 DCHECK(source->origin == Resource::Internal ||
1612 source->origin == Resource::Delegated || 1612 source->origin == Resource::Delegated ||
1613 (source->origin == Resource::External && source->mailbox.IsValid())); 1613 (source->origin == Resource::External && source->mailbox.IsValid()));
1614 DCHECK(source->allocated); 1614 DCHECK(source->allocated);
1615 DCHECK_EQ(source->wrap_mode, GL_CLAMP_TO_EDGE);
ccameron 2014/05/06 00:20:32 I added this check when implementing wrapping, to
1616 resource->id = id; 1615 resource->id = id;
1617 resource->format = source->format; 1616 resource->format = source->format;
1618 resource->mailbox_holder.texture_target = source->target; 1617 resource->mailbox_holder.texture_target = source->target;
1619 resource->filter = source->filter; 1618 resource->filter = source->filter;
1620 resource->size = source->size; 1619 resource->size = source->size;
1621 1620
1622 if (source->type == Bitmap) { 1621 if (source->type == Bitmap) {
1623 resource->mailbox_holder.mailbox = source->shared_bitmap_id; 1622 resource->mailbox_holder.mailbox = source->shared_bitmap_id;
1624 resource->is_software = true; 1623 resource->is_software = true;
1625 } else if (!source->mailbox.IsValid()) { 1624 } else if (!source->mailbox.IsValid()) {
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
2275 ContextProvider* context_provider = output_surface_->context_provider(); 2274 ContextProvider* context_provider = output_surface_->context_provider();
2276 return context_provider ? context_provider->ContextGL() : NULL; 2275 return context_provider ? context_provider->ContextGL() : NULL;
2277 } 2276 }
2278 2277
2279 class GrContext* ResourceProvider::GrContext() const { 2278 class GrContext* ResourceProvider::GrContext() const {
2280 ContextProvider* context_provider = output_surface_->context_provider(); 2279 ContextProvider* context_provider = output_surface_->context_provider();
2281 return context_provider ? context_provider->GrContext() : NULL; 2280 return context_provider ? context_provider->GrContext() : NULL;
2282 } 2281 }
2283 2282
2284 } // namespace cc 2283 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | content/browser/compositor/delegated_frame_host.h » ('j') | content/browser/compositor/delegated_frame_host.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698