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

Side by Side Diff: ppapi/proxy/compositor_layer_resource.cc

Issue 1609923002: Fix remaining incompatibilities between scoped_ptr and unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ppapi/proxy/compositor_layer_resource.h" 5 #include "ppapi/proxy/compositor_layer_resource.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "gpu/GLES2/gl2extchromium.h" 10 #include "gpu/GLES2/gl2extchromium.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 data_.texture->premult_alpha = PP_ToBool(premult); 337 data_.texture->premult_alpha = PP_ToBool(premult);
338 return PP_OK; 338 return PP_OK;
339 } 339 }
340 return PP_ERROR_BADARGUMENT; 340 return PP_ERROR_BADARGUMENT;
341 } 341 }
342 342
343 bool CompositorLayerResource::SetType(LayerType type) { 343 bool CompositorLayerResource::SetType(LayerType type) {
344 if (type == TYPE_COLOR) { 344 if (type == TYPE_COLOR) {
345 if (data_.is_null()) 345 if (data_.is_null())
346 data_.color.reset(new CompositorLayerData::ColorLayer()); 346 data_.color.reset(new CompositorLayerData::ColorLayer());
347 return data_.color; 347 return !!data_.color;
348 } 348 }
349 349
350 if (type == TYPE_TEXTURE) { 350 if (type == TYPE_TEXTURE) {
351 if (data_.is_null()) 351 if (data_.is_null())
352 data_.texture.reset(new CompositorLayerData::TextureLayer()); 352 data_.texture.reset(new CompositorLayerData::TextureLayer());
353 return data_.texture; 353 return !!data_.texture;
354 } 354 }
355 355
356 if (type == TYPE_IMAGE) { 356 if (type == TYPE_IMAGE) {
357 if (data_.is_null()) 357 if (data_.is_null())
358 data_.image.reset(new CompositorLayerData::ImageLayer()); 358 data_.image.reset(new CompositorLayerData::ImageLayer());
359 return data_.image; 359 return !!data_.image;
360 } 360 }
361 361
362 // Should not be reached. 362 // Should not be reached.
363 DCHECK(false); 363 DCHECK(false);
364 return false; 364 return false;
365 } 365 }
366 366
367 int32_t CompositorLayerResource::CheckForSetTextureAndImage( 367 int32_t CompositorLayerResource::CheckForSetTextureAndImage(
368 LayerType type, 368 LayerType type,
369 const scoped_refptr<TrackedCallback>& release_callback) { 369 const scoped_refptr<TrackedCallback>& release_callback) {
(...skipping 12 matching lines...) Expand all
382 382
383 // Do not allow using a block callback as a release callback. 383 // Do not allow using a block callback as a release callback.
384 if (release_callback->is_blocking()) 384 if (release_callback->is_blocking())
385 return PP_ERROR_BADARGUMENT; 385 return PP_ERROR_BADARGUMENT;
386 386
387 return PP_OK; 387 return PP_OK;
388 } 388 }
389 389
390 } // namespace proxy 390 } // namespace proxy
391 } // namespace ppapi 391 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698